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

x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK

All the code in early_serial_console.c gets compiled out if
!CONFIG_EARLY_PRINTK, but early_serial_console.o itself still gets
compiled in. Eliminate it from the compile entirely in that case.

This does not change the generated code at all, in either case.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>

+2 -5
+2 -1
arch/x86/boot/compressed/Makefile
··· 27 27 HOST_EXTRACFLAGS += -I$(srctree)/tools/include 28 28 29 29 vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ 30 - $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \ 30 + $(obj)/string.o $(obj)/cmdline.o \ 31 31 $(obj)/piggy.o $(obj)/cpuflags.o 32 32 33 + vmlinux-objs-$(CONFIG_EARLY_PRINTK) += $(obj)/early_serial_console.o 33 34 vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o 34 35 35 36 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
-4
arch/x86/boot/compressed/early_serial_console.c
··· 1 1 #include "misc.h" 2 2 3 - #ifdef CONFIG_EARLY_PRINTK 4 - 5 3 int early_serial_base; 6 4 7 5 #include "../early_serial_console.c" 8 - 9 - #endif