diff mbox series

[v2] cmd: Handle CONFIG_(SPL_|TPL_)ENV_SUPPORT for toggling nvedit object

Message ID 20200202130227.7755-1-nathan@nathanrossi.com
State Deferred
Delegated to: Tom Rini
Headers show
Series [v2] cmd: Handle CONFIG_(SPL_|TPL_)ENV_SUPPORT for toggling nvedit object | expand

Commit Message

Nathan Rossi Feb. 2, 2020, 1:02 p.m. UTC
When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included
as part of the build. Use the CONFIG_ENV_SUPPORT, CONFIG_SPL_ENV_SUPPORT
or CONFIG_TPL_ENV_SUPPORT values to enable/disable the inclusion of
nvedit.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
---
Changes in v2:
* Changed $(SPL_) to $(SPL_TPL_) to cover CONFIG_TPL_ENV_SUPPORT
---
 cmd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---
2.24.1

Comments

Wolfgang Denk Feb. 2, 2020, 1:51 p.m. UTC | #1
Dear Nathan,

In message <20200202130227.7755-1-nathan@nathanrossi.com> you wrote:
> When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included
> as part of the build. Use the CONFIG_ENV_SUPPORT, CONFIG_SPL_ENV_SUPPORT
> or CONFIG_TPL_ENV_SUPPORT values to enable/disable the inclusion of
> nvedit.

Why should the availability of these commands depend on any of these
settings?  I think this is wrong - whether someone wants to have
environment commands in SPL or TPM is an independent decision. You
must not dictate it in such a way for all users.

Thanks.

Best regards,

Wolfgang Denk
Nathan Rossi Feb. 2, 2020, 3:17 p.m. UTC | #2
On Sun, 2 Feb 2020 at 23:52, Wolfgang Denk <wd@denx.de> wrote:
>
> Dear Nathan,
>
> In message <20200202130227.7755-1-nathan@nathanrossi.com> you wrote:
> > When CONFIG_SPL_ENV_SUPPORT is disabled, nvedit was still being included
> > as part of the build. Use the CONFIG_ENV_SUPPORT, CONFIG_SPL_ENV_SUPPORT
> > or CONFIG_TPL_ENV_SUPPORT values to enable/disable the inclusion of
> > nvedit.
>
> Why should the availability of these commands depend on any of these
> settings?  I think this is wrong - whether someone wants to have
> environment commands in SPL or TPM is an independent decision. You
> must not dictate it in such a way for all users.

This file is dependent on code from env/, specifically code that is
conditional on the various ENV_SUPPORT configs. As the underlying
compilation issue stems from nvedit providing what appears to be
common environment code (e.g. env_get), it made sense to have nvedit
conditional on the same config.

Regards,
Nathan
diff mbox series

Patch

diff --git a/cmd/Makefile b/cmd/Makefile
index 4f29b72c69..21b867d3a9 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -186,7 +186,7 @@  endif # !CONFIG_SPL_BUILD
 obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o
 
 # core command
-obj-y += nvedit.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += nvedit.o
 
 obj-$(CONFIG_TI_COMMON_CMD_OPTIONS) += ti/