diff options
author | Rasmus Villemoes | 2020-02-19 09:47:40 +0000 |
---|---|---|
committer | Tom Rini | 2020-04-24 10:10:00 -0400 |
commit | 82b2f41357199c9fd06da80f8dd21e0576d08efe (patch) | |
tree | 5d962977aa083cf211c57c06516dbfbaf0bfd118 /env/fat.c | |
parent | 1d0adee45cc2d3257c926d6022bf1922805b928e (diff) |
env_internal.h: add alternative ENV_SAVE_PTR macro
The current definition of the env_save_ptr does not take SPL_SAVEENV
into account. Moreover, the way it is implemented means that drivers
need to guard the definitions of their _save methods with ifdefs to
avoid "defined but unused" warnings in case CMD_SAVEENV=n.
The ifdeffery can be avoided by using a "something ? x : NULL"
construction instead and still have the compiler elide the _save
method when it is not referenced. Unfortunately we can't just switch
the existing env_save_ptr macro, since that would give a lot of build
errors unless all the ifdeffery is removed at the same time.
Conversely, removing that ifdeffery first would merely lead to the
"defined but unused" warnings temporarily, but for some storage
drivers it requires a bit more work than just removing their private
CMD_SAVEENV logic.
So introduce an alternative to env_save_ptr, which for lack of a
better name is simply uppercased, allowing one to update storage
drivers piecemeal to both reduce their ifdeffery and honour
CONFIG_SPL_SAVEENV.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'env/fat.c')
0 files changed, 0 insertions, 0 deletions