public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Robert P. J. Day <rpjday@crashcourse.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Remove entirely superfluous preprocessor tests from some cmd_*.c files.
Date: Thu, 19 Nov 2009 11:00:28 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911191058270.9286@localhost> (raw)


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.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  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.


diff --git a/common/cmd_cache.c b/common/cmd_cache.c
index 0dfa336..1202258 100644
--- a/common/cmd_cache.c
+++ b/common/cmd_cache.c
@@ -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
diff --git a/common/cmd_mgdisk.c b/common/cmd_mgdisk.c
index aadc335..3ba62f6 100644
--- a/common/cmd_mgdisk.c
+++ b/common/cmd_mgdisk.c
@@ -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
========================================================================

             reply	other threads:[~2009-11-19 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 16:00 Robert P. J. Day [this message]
2009-12-02 22:47 ` [U-Boot] [PATCH v2] Remove entirely superfluous preprocessor tests from some cmd_*.c files Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0911191058270.9286@localhost \
    --to=rpjday@crashcourse.ca \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox