On Sat, Dec 25, 2010 at 11:11 PM, Wu Zhangjin <wuzhangjin@xxxxxxxxx> wrote: > !CONFIG_DEBUG_ZBOOT doesn't need puts() and puthex(), remove them and > the according strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves ^^^^^ --> corresponding > about 1280 bytes. > > Signed-off-by: Wu Zhangjin <wuzhangjin@xxxxxxxxx> > --- > 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 > >