[PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling Applies to 2.6.24-rc8-git1 This patch results from Linux Tiny's efforts to hunt for unnecessary code added unconditionally with "obj-y +=" This patch make the compilation of arch/x86/kernel/pcspeaker.c depend on PC speaker support. Before that, this file was always compiled even if pc speaker support wasn't enabled. I'm checking that CONFIG_INPUT_PCSPKR is not set to "m", as arch/x86/kernel/pcspeaker.c shouldn't be compiled as a module: - It defines no init and exit functions - It defines an initcall which only makes sense at kernel boot time. Results: if PC speaker support is disabled - It reduces the uncompressed kernel size by 218 bytes!!! ;) - It must also bring a tiny reduction in boot time but suppressing a useless initcall. Your comments? --- Signed-off-by: Michael Opdenacker <michael@free-electrons.com> diff -Naur linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32 linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32 --- linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32 2008-01-17 09:48:58.000000000 +0100 +++ linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32 2008-01-17 10:06:56.000000000 +0100 @@ -45,10 +45,13 @@ obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o obj-$(CONFIG_PARAVIRT) += paravirt_32.o -obj-y += pcspeaker.o - obj-$(CONFIG_SCx200) += scx200_32.o +ifeq ($(CONFIG_INPUT_PCSPKR),y) + obj-y += pcspeaker.o +endif + + # vsyscall_32.o contains the vsyscall DSO images as __initdata. # We must build both images before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin diff -Naur linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_64 linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_64 --- linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_64 2008-01-17 09:48:58.000000000 +0100 +++ linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_64 2008-01-17 10:19:08.000000000 +0100 @@ -40,6 +40,9 @@ obj-$(CONFIG_PCI) += early-quirks.o obj-y += topology.o -obj-y += pcspeaker.o + +ifeq ($(CONFIG_INPUT_PCSPKR),y) + obj-y += pcspeaker.o +endif CFLAGS_vsyscall_64.o := $(PROFILING) -g0 -- Michael Opdenacker, Free Electrons Free Embedded Linux Training Materials on http://free-electrons.com/training (More than 1500 pages!) --
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Ingo Molnar | [git pull] x86 arch updates for v2.6.25 |
| Anton Salikhmetov | [PATCH -v8 2/4] Update ctime and mtime for memory-mapped files |
git: | |
| Patrick McHardy | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 16/37] dccp: API to query the current TX/RX CCID |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
