diff mbox

[3.0] fix compile warnings in plat-iop/cp6.c

Message ID 20009.35057.432746.47293@pilspetsen.it.uu.se (mailing list archive)
State New, archived
Headers show

Commit Message

Mikael Pettersson July 22, 2011, 2:28 p.m. UTC
Russell King - ARM Linux writes:
 > On Fri, Jul 22, 2011 at 02:43:47PM +0200, Mikael Pettersson wrote:
 > > Building 3.0 for an n2100 (plat-iop) results in:
 > > 
 > > In file included from arch/arm/plat-iop/cp6.c:20:
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list
 > > arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type
 > > 
 > > The pt_regs and incompatible pointer type warnings are fixed by including
 > > <asm/ptrace.h> before <asm/traps.h>.  Nothing here depends on task_struct,
 > > so that warning can be fixed by a forward struct declaration.
 > 
 > Why not add a forward declaration of struct pt_regs and task_struct
 > to asm/traps.h ?

Sure, that works too.  Revised patch below.  Only tested on n2100 so far.

Building kernel 3.0 for an n2100 (plat-iop) results in:

In file included from arch/arm/plat-iop/cp6.c:20:
/tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list
/tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want
/tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list
/tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list
arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type

Nothing here depends on the layout of pt_regs or task_struct, so this
can be fixed by adding forward struct declarations to asm/traps.h.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---

Comments

Russell King - ARM Linux July 22, 2011, 3:07 p.m. UTC | #1
On Fri, Jul 22, 2011 at 04:28:01PM +0200, Mikael Pettersson wrote:
> Sure, that works too.  Revised patch below.  Only tested on n2100 so far.

Do you know when this started to go wrong - do we need to copy it to some
stable trees?

Other than that, looks fine, so -> patch system please.

Thanks.

> 
> Building kernel 3.0 for an n2100 (plat-iop) results in:
> 
> In file included from arch/arm/plat-iop/cp6.c:20:
> /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list
> /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want
> /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list
> /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list
> arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type
> 
> Nothing here depends on the layout of pt_regs or task_struct, so this
> can be fixed by adding forward struct declarations to asm/traps.h.
> 
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
> ---
> --- linux-3.0/arch/arm/include/asm/traps.h.~1~	2011-05-19 06:06:34.000000000 +0200
> +++ linux-3.0/arch/arm/include/asm/traps.h	2011-07-22 16:14:50.000000000 +0200
> @@ -3,6 +3,9 @@
>  
>  #include <linux/list.h>
>  
> +struct pt_regs;
> +struct task_struct;
> +
>  struct undef_hook {
>  	struct list_head node;
>  	u32 instr_mask;
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mikael Pettersson July 22, 2011, 4:01 p.m. UTC | #2
Russell King - ARM Linux writes:
 > On Fri, Jul 22, 2011 at 04:28:01PM +0200, Mikael Pettersson wrote:
 > > Sure, that works too.  Revised patch below.  Only tested on n2100 so far.
 > 
 > Do you know when this started to go wrong - do we need to copy it to some
 > stable trees?

2.6.39 doesn't have this problem so backporting shouldn't be necessary.

 > Other than that, looks fine, so -> patch system please.

Done, it's now "7004/1 fix traps.h compile warnings".

Thanks.

 > 
 > Thanks.
 > 
 > > 
 > > Building kernel 3.0 for an n2100 (plat-iop) results in:
 > > 
 > > In file included from arch/arm/plat-iop/cp6.c:20:
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list
 > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list
 > > arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type
 > > 
 > > Nothing here depends on the layout of pt_regs or task_struct, so this
 > > can be fixed by adding forward struct declarations to asm/traps.h.
 > > 
 > > Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
 > > ---
 > > --- linux-3.0/arch/arm/include/asm/traps.h.~1~	2011-05-19 06:06:34.000000000 +0200
 > > +++ linux-3.0/arch/arm/include/asm/traps.h	2011-07-22 16:14:50.000000000 +0200
 > > @@ -3,6 +3,9 @@
 > >  
 > >  #include <linux/list.h>
 > >  
 > > +struct pt_regs;
 > > +struct task_struct;
 > > +
 > >  struct undef_hook {
 > >  	struct list_head node;
 > >  	u32 instr_mask;
 > > 
 > > _______________________________________________
 > > linux-arm-kernel mailing list
 > > linux-arm-kernel@lists.infradead.org
 > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
 >
diff mbox

Patch

--- linux-3.0/arch/arm/include/asm/traps.h.~1~	2011-05-19 06:06:34.000000000 +0200
+++ linux-3.0/arch/arm/include/asm/traps.h	2011-07-22 16:14:50.000000000 +0200
@@ -3,6 +3,9 @@ 
 
 #include <linux/list.h>
 
+struct pt_regs;
+struct task_struct;
+
 struct undef_hook {
 	struct list_head node;
 	u32 instr_mask;