Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, boot: Exclude early_serial_console.c if can't use it.

Removes early_serial_console.c code if we don't have the config option that
enables it (EARLY_PRINTK). When disabling this code, make early_serial_base a
constant 0 to allow the compiler to optimize away the code that checks for
early_serial_base.

Signed-off-by: Joe Millenbach <jmillenbach@gmail.com>
Link: http://lkml.kernel.org/r/1342746282-28497-7-git-send-email-jmillenbach@gmail.com
Signed-off-by: Gokul Caushik <caushik1@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

authored by

Joe Millenbach and committed by
H. Peter Anvin
cec49df9 641a1ceb

+14
+4
arch/x86/boot/compressed/early_serial_console.c
··· 1 1 #include "misc.h" 2 2 3 + #ifdef CONFIG_EARLY_PRINTK 4 + 3 5 int early_serial_base; 4 6 5 7 #include "../early_serial_console.c" 8 + 9 + #endif
+10
arch/x86/boot/compressed/misc.h
··· 43 43 int cmdline_find_option_bool(const char *option); 44 44 45 45 /* early_serial_console.c */ 46 + #ifdef CONFIG_EARLY_PRINTK 47 + 46 48 extern int early_serial_base; 47 49 void console_init(void); 50 + 51 + #else 52 + 53 + static const int early_serial_base; 54 + static inline void console_init(void) 55 + { } 56 + 57 + #endif 48 58 49 59 #endif