2004-03-26 17:33:59

by Meelis Roos

[permalink] [raw]
Subject: [PATCH] asm-ppc/elf.h warning

Just got this from current 2.6 BK:

CC arch/ppc/boot/simple/misc.o
In file included from include/linux/elf.h:5,
from arch/ppc/boot/simple/misc.c:20:
include/asm/elf.h:102: warning: `struct task_struct' declared inside parameter list
include/asm/elf.h:102: warning: its scope is only this definition or declaration, which is probably not what you want

This can be cured by either including linux/sched.h or defining
struct task_struct;
(like this - maybe it should be more close to the headers)

===== include/asm-ppc/elf.h 1.10 vs edited =====
--- 1.10/include/asm-ppc/elf.h Wed Mar 24 04:49:17 2004
+++ edited/include/asm-ppc/elf.h Fri Mar 26 18:40:42 2004
@@ -99,6 +99,7 @@
((t)->thread.regs? \
({ ELF_CORE_COPY_REGS((elfregs), (t)->thread.regs); 1; }): 0)

+struct task_struct;
extern int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpu);
#define ELF_CORE_COPY_FPREGS(t, fpu) dump_task_fpu((t), (fpu))


--
Meelis Roos ([email protected])




2004-03-26 17:43:53

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] asm-ppc/elf.h warning

On Fri, Mar 26, 2004 at 07:33:55PM +0200, Meelis Roos wrote:

> Just got this from current 2.6 BK:
>
> CC arch/ppc/boot/simple/misc.o
> In file included from include/linux/elf.h:5,
> from arch/ppc/boot/simple/misc.c:20:
> include/asm/elf.h:102: warning: `struct task_struct' declared inside parameter list
> include/asm/elf.h:102: warning: its scope is only this definition or declaration, which is probably not what you want
>
> This can be cured by either including linux/sched.h or defining
> struct task_struct;
> (like this - maybe it should be more close to the headers)

Can you try just removing <linux/elf.h> from everything in
arch/ppc/boot/ ?

--
Tom Rini
http://gate.crashing.org/~trini/

2004-03-26 18:00:18

by Meelis Roos

[permalink] [raw]
Subject: Re: [PATCH] asm-ppc/elf.h warning

> Can you try just removing <linux/elf.h> from everything in
> arch/ppc/boot/ ?

elf.h include is present in arch/ppc/boot/simple/misc.c and
arch/ppc/boot/simple/misc-embedded.c. The first one caused my warning
and the include can be safely removed from there. The other file is not
used in my config (prep) but I did try to compile it with elf.h include
removed (make arch/ppc/boot/simple/misc-embedded.o) and it failed. So
here is the patch against arch/ppc/boot/simple/misc.c. Nevertheless,
asm-ppc/elf.h can not be included by itself without a warning about
struct task_struct - is this a problem or not?

===== arch/ppc/boot/simple/misc.c 1.18 vs edited =====
--- 1.18/arch/ppc/boot/simple/misc.c Tue Mar 2 01:34:28 2004
+++ edited/arch/ppc/boot/simple/misc.c Fri Mar 26 19:51:24 2004
@@ -17,7 +17,6 @@
*/

#include <linux/types.h>
-#include <linux/elf.h>
#include <linux/config.h>
#include <linux/string.h>

--
Meelis Roos ([email protected])

2004-03-26 18:21:59

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] asm-ppc/elf.h warning

On Fri, Mar 26, 2004 at 08:00:06PM +0200, Meelis Roos wrote:

> > Can you try just removing <linux/elf.h> from everything in
> > arch/ppc/boot/ ?
>
> elf.h include is present in arch/ppc/boot/simple/misc.c and
> arch/ppc/boot/simple/misc-embedded.c. The first one caused my warning
> and the include can be safely removed from there. The other file is not
> used in my config (prep) but I did try to compile it with elf.h include
> removed (make arch/ppc/boot/simple/misc-embedded.o) and it failed. So
> here is the patch against arch/ppc/boot/simple/misc.c.

Ok, I'll look into that myself.

> Nevertheless,
> asm-ppc/elf.h can not be included by itself without a warning about
> struct task_struct - is this a problem or not?

It depends on if (a) other arches have a task_struct-needing extern in
this file and (b) what do they do? There's at least a few #includes
with implicit #include requirements out there, i _think_.

--
Tom Rini
http://gate.crashing.org/~trini/

2004-03-26 21:40:34

by Greg Weeks

[permalink] [raw]
Subject: Re: [PATCH] asm-ppc/elf.h warning

Meelis Roos wrote:

>>Can you try just removing <linux/elf.h> from everything in
>>arch/ppc/boot/ ?
>>
>>
>
>elf.h include is present in arch/ppc/boot/simple/misc.c and
>arch/ppc/boot/simple/misc-embedded.c. The first one caused my warning
>and the include can be safely removed from there. The other file is not
>used in my config (prep) but I did try to compile it with elf.h include
>removed (make arch/ppc/boot/simple/misc-embedded.o) and it failed. So
>here is the patch against arch/ppc/boot/simple/misc.c. Nevertheless,
>asm-ppc/elf.h can not be included by itself without a warning about
>struct task_struct - is this a problem or not?
>
>
I checked and I simply removed it when building for an ep8260. What
board still needs it?

Greg Weeks