]> git.karo-electronics.de Git - linux-beck.git/commitdiff
MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT
authorWu Zhangjin <wuzhangjin@gmail.com>
Sat, 25 Dec 2010 15:11:49 +0000 (23:11 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 2 Apr 2015 11:54:25 +0000 (13:54 +0200)
!CONFIG_DEBUG_ZBOOT doesn't need puts() and puthex(), remove them and
the corrospindig strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves
about 1280 bytes.

[ralf@linux-mips.org: Resolved reject.]

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/1898/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/boot/compressed/Makefile
arch/mips/boot/compressed/decompress.c

index 82d0b131a3db7d3b46c553740a3c3de6bb7e3513..dc91bde10d622e3d3fd90f77646f33f3232b6a9b 100644 (file)
@@ -32,9 +32,10 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
 targets := head.o decompress.o string.o dbg.o uart-16550.o uart-alchemy.o
 
 # decompressor objects (linked with vmlinuz)
-vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/dbg.o
+vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
 
 ifdef CONFIG_DEBUG_ZBOOT
+vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT)                 += $(obj)/dbg.o
 vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
 vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)                += $(obj)/uart-alchemy.o
 endif
index 31903cf9709d6d5b755a22ef0e478ea7fc3585de..54831069a206249444b31e40c4c749a37a667aa2 100644 (file)
@@ -28,8 +28,13 @@ unsigned long free_mem_end_ptr;
 extern unsigned char __image_begin, __image_end;
 
 /* debug interfaces  */
+#ifdef CONFIG_DEBUG_ZBOOT
 extern void puts(const char *s);
 extern void puthex(unsigned long long val);
+#else
+#define puts(s) do {} while (0)
+#define puthex(val) do {} while (0)
+#endif
 
 void error(char *x)
 {