Skip to contentSkip to conversation

Remove entirely superfluous preprocessor tests from cmd_*.c files.

PATCH New Robert P. J. Day 2 participants 3 messages Nov 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove entirely superfluous preprocessor tests from cmd_*.c files.

A small number of common/cmd_*.c files contain preprocessor tests that are apparently superfluous since those same tests are used in the Makefile to control the compilation of those files. Those tests are clearly redundant as long as they surround the entirety of the source in those files.

---

based on simple visual inspection, i can't see how those tests could
make any difference so they might as well be tossed.

common/cmd_cache.c +0 -4
index 0dfa336..1202258 100644
@@ -27,8 +27,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_CACHE)
-
 static int on_off (const char *);
 
 int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -108,5 +106,3 @@ U_BOOT_CMD(
 	"[on, off]\n"
 	"    - enable or disable data (writethrough) cache"
 );
-
-#endif
common/cmd_license.c +0 -4
index 141215b..c6f272a 100644
@@ -23,8 +23,6 @@
 
 #include <common.h>
 
-#if defined(CONFIG_CMD_LICENSE)
-
 /* COPYING is currently 15951 bytes in size */
 #define LICENSE_MAX	20480
 
@@ -56,5 +54,3 @@ U_BOOT_CMD(license, 1, 1, do_license,
 	"print GPL license text",
 	""
 );
-
-#endif /* CONFIG_CMD_LICENSE */
common/cmd_mgdisk.c +0 -4
index aadc335..3ba62f6 100644
@@ -24,8 +24,6 @@
 #include <common.h>
 #include <command.h>
 
-#if defined (CONFIG_CMD_MG_DISK)
-
 #include <mg_disk.h>
 
 int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -72,5 +70,3 @@ U_BOOT_CMD(
 	"    - sector read : mgd readsec [sector] [to] [counts]\n"
 	"    - sector write : mgd writesec [from] [sector] [counts]"
 );
-
-#endif

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

========================================================================

#1 lore raw

PATCH 1/1 Remove entirely superfluous preprocessor tests from cmd_*.c files.

common/cmd_license.c U_BOOT_CMD(license, 1, 1, do_license, · line 60

Quoted 12 lines
common/cmd_license.c +0 -4
-#if defined(CONFIG_CMD_LICENSE)
-
 /* COPYING is currently 15951 bytes in size */
 #define LICENSE_MAX	20480
@@ -56,5 +54,3 @@ U_BOOT_CMD(license, 1, 1, do_license,
 	"print GPL license text",
 	""
 );
-
-#endif /* CONFIG_CMD_LICENSE */

Hi Robert,
Thanks for the cleanup. The above change was recently submitted, but hasn't been applied yet. Search for "cmd_license: Remove unneeded #ifdef CONFIG_CMD_LICENSE". Could you remove the above chunk from your patch and resubmit so as to prevent a conflict when Wolfgang applies both patches?

Best,
Peter

#2 lore raw

PATCH 1/1 Remove entirely superfluous preprocessor tests from cmd_*.c files.

Quoted 6 lines · Peter Tyser
Quoted 6 lines
common/cmd_license.c +0 -2
-#if defined(CONFIG_CMD_LICENSE)
-
 /* COPYING is currently 15951 bytes in size */
 #define LICENSE_MAX	20480
Quoted 13 lines

common/cmd_license.c U_BOOT_CMD(license, 1, 1, do_license, · line 60

Quoted 6 lines
common/cmd_license.c +0 -2
@@ -56,5 +54,3 @@ U_BOOT_CMD(license, 1, 1, do_license,
 	"print GPL license text",
 	""
 );
-
-#endif /* CONFIG_CMD_LICENSE */

Hi Robert,
Thanks for the cleanup. The above change was recently submitted, but hasn't been applied yet. Search for "cmd_license: Remove unneeded #ifdef CONFIG_CMD_LICENSE". Could you remove the above chunk from your patch and resubmit so as to prevent a conflict when Wolfgang applies both patches?

okey dokey, coming right up.

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

========================================================================