linux-mips
[Top] [All Lists]

[PATCH] MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT
From: Wu Zhangjin <wuzhangjin@gmail.com>
Date: Sat, 25 Dec 2010 23:11:49 +0800
Cc: linux-mips@linux-mips.org, Wu Zhangjin <wuzhangjin@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=mlzF2yGiJe7Ex74hpMfzqWU7t8RFy8FOL+eraui2WCs=; b=AuUqXlrrIcrO1DenJhp1iX+IP0izrwWdsnxBcebn460aMy4VPHYp2jLfgq4e20OxPW 0kBy4cvFhvJrJbxs412RJrzw31QWi8Cv46i4JV27Pb5kBlK9gLm0WDOl2kAOpoOoOhm8 YP6s3G5vj1LmV9xpPwO5+NNhOn1Y/vPEjMUU4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=HkGMB33rWjA0OZziyygQtvM0lQqQEt6HcmR3qm47QIDLoGyVnO02tXiAaYatG8+LP5 Xnf/hoEw9IlFLZuxCfRIW+2DZBjmAYyA0DOZ7cX16vrmY8DzBr9rQvrYhX9f1bHZhT+s lpu6zd12MwD1qtMWAW3l+//nuROo9YhEcpqw4=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
!CONFIG_DEBUG_ZBOOT doesn't need puts() and puthex(), remove them and
the according strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves
about 1280 bytes.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/boot/compressed/Makefile     |    3 ++-
 arch/mips/boot/compressed/decompress.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/mips/boot/compressed/Makefile 
b/arch/mips/boot/compressed/Makefile
index 5042d51..aab6d7f 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -28,9 +28,10 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) 
-D__ASSEMBLY__ \
 targets := head.o decompress.o dbg.o uart-16550.o uart-alchemy.o
 
 # decompressor objects (linked with vmlinuz)
-vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/dbg.o
+vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o
 
 ifdef CONFIG_DEBUG_ZBOOT
+vmlinuzobjs-y += $(obj)/dbg.o
 vmlinuzobjs-$(CONFIG_SYS_SUPPORTS_ZBOOT_UART16550) += $(obj)/uart-16550.o
 vmlinuzobjs-$(CONFIG_MIPS_ALCHEMY)                += $(obj)/uart-alchemy.o
 endif
diff --git a/arch/mips/boot/compressed/decompress.c 
b/arch/mips/boot/compressed/decompress.c
index 5cad0fa..c9cbff5 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -27,8 +27,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)
 {
-- 
1.7.1


<Prev in Thread] Current Thread [Next in Thread>