All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] CMD_SAVEENV ifdef cleanup
@ 2020-02-19  9:47 Rasmus Villemoes
  2020-02-19  9:47 ` [PATCH 1/5] env: add SAVEENV as an alias of the CMD_SAVEENV symbol Rasmus Villemoes
                   ` (7 more replies)
  0 siblings, 8 replies; 35+ messages in thread
From: Rasmus Villemoes @ 2020-02-19  9:47 UTC (permalink / raw)
  To: u-boot

The various env storage drivers almost all have their own logic [1]
for deciding whether to compile and provide the .save method, many of
which fail to honour CONFIG_SPL_SAVEENV. For example, fat.c and sf.c
define a CMD_SAVEENV macro only for !CONFIG_SPL_BUILD, while ext4.c
"only" depends on CONFIG_CMD_SAVEENV - but CONFIG_SPL_SAVEENV=y,
CONFIG_CMD_SAVEENV=n is a valid combination.

A lot of that ifdeffery can be removed while at the same time
providing the .save method if either CONFIG_SPL_SAVEENV (for an SPL
build) or CONFIG_CMD_SAVEENV (for U-Boot proper) is set. The first two
patches introduce infrastructure for that, while the last three are
example conversions for the above-mentioned three storage drivers. The
sf.c is the one I need to use in the SPL and have actually tested,
ext4.c and fat.c are included mostly as low-hanging fruit.

[1] Here's the current conditions for which these three drivers
provide .save:

          SPL                     U-Boot
ext4.c    CONFIG_CMD_SAVEENV=y    CONFIG_CMD_SAVEENV=y
fat.c     never                   CONFIG_CMD_SAVEENV=y
sf.c      never                   CONFIG_CMD_SAVEENV=y [2]

[2] It always compiles env_sf_save for U-Boot proper, but then the use
of env_save_ptr() ends up with a build warning in case
CONFIG_CMD_SAVEENV=n - fat.c doesn't have that proplem.

Rasmus Villemoes (5):
  env: add SAVEENV as an alias of the CMD_SAVEENV symbol
  env_internal.h: add alternative ENV_SAVE_PTR macro
  env/fat.c: remove private CMD_SAVEENV logic
  env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef
  env/sf.c: drop private CMD_SAVEENV logic

 env/Kconfig            |  3 +++
 env/ext4.c             |  4 +---
 env/fat.c              |  9 +--------
 env/sf.c               | 12 +-----------
 include/env_internal.h |  2 ++
 5 files changed, 8 insertions(+), 22 deletions(-)

-- 
2.23.0

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2020-05-11 16:06 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19  9:47 [PATCH 0/5] CMD_SAVEENV ifdef cleanup Rasmus Villemoes
2020-02-19  9:47 ` [PATCH 1/5] env: add SAVEENV as an alias of the CMD_SAVEENV symbol Rasmus Villemoes
2020-04-24 17:08   ` Tom Rini
2020-02-19  9:47 ` [PATCH 2/5] env_internal.h: add alternative ENV_SAVE_PTR macro Rasmus Villemoes
2020-04-24 17:08   ` Tom Rini
2020-02-19  9:47 ` [PATCH 3/5] env/fat.c: remove private CMD_SAVEENV logic Rasmus Villemoes
2020-02-19 13:27   ` Wolfgang Denk
2020-02-20 14:22     ` Rasmus Villemoes
2020-02-21 16:14       ` Wolfgang Denk
2020-02-21 16:19         ` Tom Rini
2020-02-24 14:49           ` Rasmus Villemoes
2020-04-24 17:08   ` Tom Rini
2020-02-19  9:47 ` [PATCH 4/5] env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef Rasmus Villemoes
2020-04-24 17:08   ` Tom Rini
2020-02-19  9:47 ` [PATCH 5/5] env/sf.c: drop private CMD_SAVEENV logic Rasmus Villemoes
2020-04-24 17:08   ` Tom Rini
2020-02-19 13:25 ` [PATCH 0/5] CMD_SAVEENV ifdef cleanup Wolfgang Denk
2020-02-19 13:43   ` Rasmus Villemoes
2020-03-24 19:42 ` Rasmus Villemoes
2020-03-25  7:50   ` Wolfgang Denk
2020-03-25 11:37     ` Rasmus Villemoes
2020-03-26 14:31       ` Wolfgang Denk
2020-03-26 16:04         ` Rasmus Villemoes
2020-03-26 23:01 ` [PATCH v2 0/2] allow CONFIG_SPL_SAVEENV to work with ENV_IS_IN_SPI_FLASH Rasmus Villemoes
2020-03-26 23:01   ` [PATCH v2 1/2] env: add SAVEENV as an alias of the CMD_SAVEENV symbol Rasmus Villemoes
2020-05-08 22:59     ` Tom Rini
2020-03-26 23:02   ` [PATCH v2 2/2] env/sf.c: honour CONFIG_SPL_SAVEENV Rasmus Villemoes
2020-05-08 22:59     ` Tom Rini
2020-05-09 18:56       ` Rasmus Villemoes
2020-05-09 20:54         ` Tom Rini
2020-05-11  6:49           ` Rasmus Villemoes
2020-05-11 16:06             ` Tom Rini
2020-03-27 16:31   ` [PATCH v2 0/2] allow CONFIG_SPL_SAVEENV to work with ENV_IS_IN_SPI_FLASH Wolfgang Denk
2020-03-27 20:06     ` Rasmus Villemoes
2020-03-30 10:40       ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.