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] Move the preprocessor test for building flash.c to the Makefile.
Date: Thu, 19 Nov 2009 12:38:42 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911191234190.12912@localhost> (raw)


Move the preprocessor test of CONFIG_SYS_NO_FLASH out of flash.c and
back to the Makefile, for readability.

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

---

  this one is a little uglier since it adds an "#ifndef" check to the
Makefile, but i still consider this to be more readable since it's
potentially misleading to have a hard-coded build of a file in the
Makefile, only to have to go that file to notice that a subsequent
preprocessor check takes the file out of play.  except in weird
circumstances, tests like that should be in the Makefile.

  i don't think there's a lot of this left.


diff --git a/common/Makefile b/common/Makefile
index 3781738..69629f5 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -152,7 +152,9 @@ COBJS-$(CONFIG_VFD) += cmd_vfd.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
+#ifndef CONFIG_SYS_NO_FLASH
 COBJS-y += flash.o
+#endif
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
 COBJS-$(CONFIG_LCD) += lcd.o
diff --git a/common/flash.c b/common/flash.c
index eb4b2f5..f5da566 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -26,8 +26,6 @@
 #include <common.h>
 #include <flash.h>

-#if !defined(CONFIG_SYS_NO_FLASH)
-
 extern flash_info_t  flash_info[]; /* info for FLASH chips */

 /*-----------------------------------------------------------------------
@@ -222,7 +220,3 @@ void flash_perror (int err)
 		break;
 	}
 }
-
-/*-----------------------------------------------------------------------
- */
-#endif /* !CONFIG_SYS_NO_FLASH */

========================================================================
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 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 17:38 Robert P. J. Day [this message]
2009-11-19 18:03 ` [U-Boot] [PATCH] Move the preprocessor test for building flash.c to the Makefile Mike Frysinger
2009-11-19 18:03   ` Robert P. J. Day

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.0911191234190.12912@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