[PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Jan 3 10:42:18 EST 2012


On Mon, Jan 02, 2012 at 06:38:45PM -0200, Fabio Estevam wrote:
> Fix the following build warning:
> 
>   CC      arch/arm/kernel/setup.o
> In file included from arch/arm/kernel/setup.c:39:
> arch/arm/include/asm/elf.h:102:1: warning: "vmcore_elf64_check_arch" redefined
> In file included from arch/arm/kernel/setup.c:24:
> include/linux/crash_dump.h:30:1: warning: this is the location of the previous definition
> 
> Since commit 93a72052 (crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn)
> the inclusion of <linux/crash_dump.h> is no longer needed.
> 
> Remove the inclusion of <linux/crash_dump.h> and the build warning is fixed.

Actually, this is fragile.  This is _excessively_ fragile.

linux/crash_dump.h makes no attempt to include asm/elf.h, but it depends
on stuff in asm/elf.h to determine how stuff inside this file is defined
at parse time.

So, if asm/elf.h is included after linux/crash_dump.h or not at all, you
get a different result from the situation where asm/elf.h is included
before.

Therefore, while this change may on the face of it seem correct, it's
only a sticky plaster over the problem by avoiding the situation rather
than fixing it properly.

I won't apply this until the real problem (missing include in
linux/crash_dump.h) is resolved.



More information about the linux-arm-kernel mailing list