Skip to contentSkip to conversation

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

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

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Remove entirely superfluous preprocessor tests from some 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.

---

revision of earlier patch, dropping change to cmd_license.c since
that's already been submitted.

there *are* at least a couple more files like this but they'll
require slightly different tweaking so i'm doing those separately.

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_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 v2 1/1 Remove entirely superfluous preprocessor tests from some cmd_*.c files.

Dear "Robert P. J. Day",

Quoted 8 lines · In message <alpine.LFD.2.00.0911191058270.9286@localhost> you wrote:

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.

Applied, thanks.

But *please* consider using git-format-patch / git-send-email.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
To understand a program you must become  both  the  machine  and  the
program.