[U-Boot] [PATCH 2/2] config_cmd_default.h: wrap each definition in "ifndef"

Alexey Brodkin Alexey.Brodkin at synopsys.com
Sat Jan 3 14:20:09 CET 2015


Now with switch to Kconfig it's possible to select commands via
menuconfig or defconfigs.

Moreover some commands are enabled by default in both
"config_cmd_default.h" as a legacy way and in "common/Kconfig".

And on attempt to build U-Boot following warnings are printed for
definitions made in both:
--->---
In file included from include/configs/arcangel4.h:45:0,
                 from include/config.h:4,
                 from include/common.h:18,
                 from examples/standalone/stubs.c:1:
include/config_cmd_default.h:20:0: warning: "CONFIG_CMD_BDI" redefined
[enabled by default]
 #define CONFIG_CMD_BDI  /* bdinfo   */
 ^
In file included from ././include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:10:0: note: this is the location of the
previous definition
 #define CONFIG_CMD_BDI 1
 ^
--->---

An obvious fix is to wrap all definitions in "config_cmd_default.h"
since we still have to keep it util we're done with complete switch to
Kconfig.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Tom Rini <trini at ti.com>
---
 include/config_cmd_default.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/include/config_cmd_default.h b/include/config_cmd_default.h
index 73c9544..b33f21b 100644
--- a/include/config_cmd_default.h
+++ b/include/config_cmd_default.h
@@ -16,28 +16,70 @@
  * hardware, not fully tested, etc.).
  */
 
+#ifndef CONFIG_CMD_BDI
 #define CONFIG_CMD_BDI		/* bdinfo			*/
+#endif
+#ifndef CONFIG_CMD_BOOTD
 #define CONFIG_CMD_BOOTD	/* bootd			*/
+#endif
+#ifndef CONFIG_CMD_CONSOLE
 #define CONFIG_CMD_CONSOLE	/* coninfo			*/
+#endif
+#ifndef CONFIG_CMD_ECHO
 #define CONFIG_CMD_ECHO		/* echo arguments		*/
+#endif
+#ifndef CONFIG_CMD_EDITENV
 #define CONFIG_CMD_EDITENV	/* editenv			*/
+#endif
+#ifndef CONFIG_CMD_FPGA
 #define CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
+#endif
+#ifndef CONFIG_CMD_IMI
 #define CONFIG_CMD_IMI		/* iminfo			*/
+#endif
+#ifndef CONFIG_CMD_ITEST
 #define CONFIG_CMD_ITEST	/* Integer (and string) test	*/
+#endif
 #ifndef CONFIG_SYS_NO_FLASH
+#ifndef CONFIG_CMD_FLASH
 #define CONFIG_CMD_FLASH	/* flinfo, erase, protect	*/
+#endif
+#ifndef CONFIG_CMD_IMLS
 #define CONFIG_CMD_IMLS		/* List all found images	*/
 #endif
+#endif /* CONFIG_SYS_NO_FLASH */
+#ifndef CONFIG_CMD_LOADB
 #define CONFIG_CMD_LOADB	/* loadb			*/
+#endif
+#ifndef CONFIG_CMD_LOADS
 #define CONFIG_CMD_LOADS	/* loads			*/
+#endif
+#ifndef CONFIG_CMD_MEMORY
 #define CONFIG_CMD_MEMORY	/* md mm nm mw cp cmp crc base loop */
+#endif
+#ifndef CONFIG_CMD_MISC
 #define CONFIG_CMD_MISC		/* Misc functions like sleep etc*/
+#endif
+#ifndef CONFIG_CMD_NET
 #define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+#ifndef CONFIG_CMD_NFS
 #define CONFIG_CMD_NFS		/* NFS support			*/
+#endif
+#ifndef CONFIG_CMD_RUN
 #define CONFIG_CMD_RUN		/* run command in env variable	*/
+#endif
+#ifndef CONFIG_CMD_SAVEENV
 #define CONFIG_CMD_SAVEENV	/* saveenv			*/
+#endif
+#ifndef CONFIG_CMD_SETGETDCR
 #define CONFIG_CMD_SETGETDCR	/* DCR support on 4xx		*/
+#endif
+#ifndef CONFIG_CMD_SOURCE
 #define CONFIG_CMD_SOURCE	/* "source" command support	*/
+#endif
+#ifndef CONFIG_CMD_XIMG
 #define CONFIG_CMD_XIMG		/* Load part of Multi Image	*/
+#endif
 
 #endif	/* _CONFIG_CMD_DEFAULT_H */
-- 
2.1.0



More information about the U-Boot mailing list