Skip to contentSkip to conversation

common/{hush, kgdb, serial}.c: build by COBJS-$(...) in Makefile

PATCH New Mike Frysinger 2 participants 2 messages Feb 6, 2009 – Feb 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/{hush, kgdb, serial}.c: build by COBJS-$(...) in Makefile

Move global '#ifdef CONFIG_xxx .... #endif' out of the .c files and into the COBJS-$(CONFIG_xxx) in the Makefile. Also delete unused var in kgdb code in the process.

---
 common/Makefile |    6 +++---
 common/hush.c   |    2 --
 common/kgdb.c   |    7 -------
 common/serial.c |    4 ----
 4 files changed, 3 insertions(+), 16 deletions(-)
common/Makefile +3 -3
index 88ee981..eae0244 100644
@@ -35,11 +35,11 @@ COBJS-y += command.o
 COBJS-y += devices.o
 COBJS-y += dlmalloc.o
 COBJS-y += exports.o
-COBJS-y += hush.o
+COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
-COBJS-y += serial.o
+COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += xyzModem.o
 
 # core command
@@ -145,7 +145,7 @@ COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
 COBJS-y += flash.o
-COBJS-y += kgdb.o
+COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
 COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
common/hush.c +0 -2
index 9aef6e4..d7aca89 100644
@@ -96,7 +96,6 @@
 /*cmd_boot.c*/
 extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */
 #endif
-#ifdef CONFIG_SYS_HUSH_PARSER
 #ifndef __U_BOOT__
 #include <ctype.h>     /* isalpha, isdigit */
 #include <unistd.h>    /* getpid */
@@ -3632,5 +3631,4 @@ U_BOOT_CMD(
 );
 
 #endif
-#endif /* CONFIG_SYS_HUSH_PARSER */
 /****************************************************************************/
common/kgdb.c +0 -7
index adc15dd..f6e50a0 100644
@@ -92,8 +92,6 @@
 #include <kgdb.h>
 #include <command.h>
 
-#if defined(CONFIG_CMD_KGDB)
-
 #undef KGDB_DEBUG
 
 /*
@@ -587,8 +585,3 @@ U_BOOT_CMD(
 	"      program if it is executed (see the \"hello_world\"\n"
 	"      example program in the U-Boot examples directory)."
 );
-#else
-
-int kgdb_not_configured = 1;
-
-#endif
common/serial.c +0 -4
index b38d1e7..09385d0 100644
@@ -27,8 +27,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_SERIAL_MULTI)
-
 static struct serial_device *serial_devices = NULL;
 static struct serial_device *serial_current = NULL;
 
@@ -255,5 +253,3 @@ void serial_puts (const char *s)
 
 	serial_current->puts (s);
 }
-
-#endif /* CONFIG_SERIAL_MULTI */
Signature · 1 line
1.6.1.2
#1 lore raw

PATCH 1/1 common/{hush, kgdb, serial}.c: build by COBJS-$(...) in Makefile

Dear Mike Frysinger,

Quoted 11 lines · In message <[email protected]> you wrote:

Move global '#ifdef CONFIG_xxx .... #endif' out of the .c files and into the COBJS-$(CONFIG_xxx) in the Makefile. Also delete unused var in kgdb code in the process.

---
 common/Makefile |    6 +++---
 common/hush.c   |    2 --
 common/kgdb.c   |    7 -------
 common/serial.c |    4 ----
 4 files changed, 3 insertions(+), 16 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 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
You might not be as stupid as you look. This is not hard. Let's think
about this. I mean ... I'll think about this, and  you  can  join  in
when you know the words.             - Terry Pratchett, _Men at Arms_