linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: setup.c: Change the order of include files to avoid build warning
@ 2012-01-02 20:11 Fabio Estevam
  2012-01-02 20:38 ` [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2012-01-02 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

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

If <asm/elf.h> is defined prior to <linux/crash_dump.h> the warning does not happen because 
vmcore_elf64_check_arch is defined at <asm/elf.h>, so change the order of the includes to avoid the warning.

This warning was introduced by commit cea0bb1b (ARM: 6122/1: kdump: add support for elfcorehdr parameter).

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/kernel/setup.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 129fbd5..749e0b2 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -21,7 +21,6 @@
 #include <linux/init.h>
 #include <linux/kexec.h>
 #include <linux/of_fdt.h>
-#include <linux/crash_dump.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
 #include <linux/interrupt.h>
@@ -55,6 +54,8 @@
 #include <asm/unwind.h>
 #include <asm/memblock.h>
 
+#include <linux/crash_dump.h>
+
 #if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
 #include "compat.h"
 #endif
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file
  2012-01-02 20:11 [PATCH] ARM: setup.c: Change the order of include files to avoid build warning Fabio Estevam
@ 2012-01-02 20:38 ` Fabio Estevam
  2012-01-03 15:42   ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2012-01-02 20:38 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Instead of changing the order of the includes, simply remove the unneeded crash_dump.h header.
 arch/arm/kernel/setup.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 129fbd5..303bdb2 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -21,7 +21,6 @@
 #include <linux/init.h>
 #include <linux/kexec.h>
 #include <linux/of_fdt.h>
-#include <linux/crash_dump.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
 #include <linux/interrupt.h>
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file
  2012-01-02 20:38 ` [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file Fabio Estevam
@ 2012-01-03 15:42   ` Russell King - ARM Linux
  2012-01-13 15:40     ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2012-01-03 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file
  2012-01-03 15:42   ` Russell King - ARM Linux
@ 2012-01-13 15:40     ` Fabio Estevam
  2012-01-13 15:46       ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2012-01-13 15:40 UTC (permalink / raw)
  To: linux-arm-kernel

Russell,

On Tue, Jan 3, 2012 at 1:42 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

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

As per your recommendation, I sent a patch to fix the missing include
in crash_dump.h.

It appears at Linus' tree as commit 1f536b9e
(include/linux/crash_dump.h needs elf.h) now.

Should I submit this patch on your patch tracking system?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file
  2012-01-13 15:40     ` Fabio Estevam
@ 2012-01-13 15:46       ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2012-01-13 15:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 13, 2012 at 01:40:15PM -0200, Fabio Estevam wrote:
> Russell,
> 
> On Tue, Jan 3, 2012 at 1:42 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> 
> > I won't apply this until the real problem (missing include in
> > linux/crash_dump.h) is resolved.
> 
> As per your recommendation, I sent a patch to fix the missing include
> in crash_dump.h.
> 
> It appears at Linus' tree as commit 1f536b9e
> (include/linux/crash_dump.h needs elf.h) now.
> 
> Should I submit this patch on your patch tracking system?

Yes please.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-13 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-02 20:11 [PATCH] ARM: setup.c: Change the order of include files to avoid build warning Fabio Estevam
2012-01-02 20:38 ` [PATCH v2] ARM: setup.c: Fix build warning by removing unneeded header file Fabio Estevam
2012-01-03 15:42   ` Russell King - ARM Linux
2012-01-13 15:40     ` Fabio Estevam
2012-01-13 15:46       ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).