netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: linux-next: Tree for June 9 (niu)
       [not found] <20100609133443.38f1f957.sfr@canb.auug.org.au>
@ 2010-06-09 17:36 ` Randy Dunlap
  2010-06-09 18:06   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2010-06-09 17:36 UTC (permalink / raw)
  To: Stephen Rothwell, netdev; +Cc: linux-next, LKML, davem

On Wed, 9 Jun 2010 13:34:43 +1000 Stephen Rothwell wrote:

> Hi all,
> 
> Changes since 20100608:
> 
> My fixes tree contains:
>       v4l-dvb: update gfp/slab.h includes
>       arm: update gfp/slab.h includes
>       davinci: update gfp/slab.h includes
>       ocfs2: update gfp/slab.h includes
>       acpi: update gfp/slab.h includes



on x86_64 or i386, CONFIG_OF_DEVICE is not enabled:

drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/niu.c:9716: warning: assignment from incompatible pointer type

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: linux-next: Tree for June 9 (niu)
  2010-06-09 17:36 ` linux-next: Tree for June 9 (niu) Randy Dunlap
@ 2010-06-09 18:06   ` David Miller
  2010-06-09 18:08     ` Randy Dunlap
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Miller @ 2010-06-09 18:06 UTC (permalink / raw)
  To: randy.dunlap; +Cc: sfr, netdev, linux-next, linux-kernel

From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Wed, 9 Jun 2010 10:36:57 -0700

> On Wed, 9 Jun 2010 13:34:43 +1000 Stephen Rothwell wrote:
> 
>> Changes since 20100608:
>> 
>> My fixes tree contains:
>>       v4l-dvb: update gfp/slab.h includes
>>       arm: update gfp/slab.h includes
>>       davinci: update gfp/slab.h includes
>>       ocfs2: update gfp/slab.h includes
>>       acpi: update gfp/slab.h includes
> 
> 
> 
> on x86_64 or i386, CONFIG_OF_DEVICE is not enabled:
> 
> drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
> drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
> drivers/net/niu.c:9716: warning: assignment from incompatible pointer type

Hmmm, I'm confused why this never happened before :-)

We conditionalize linux/of_device.h inclusion with CONFIG_SPARC64, yet
we unconditionally use "struct of_device *" pointers in the driver
with no such ifdef protection.

Even if we unconditionally included linux/of_device.h, that file does
nothing unless CONFIG_OF_DEVICE is defined so it should have always
produced these warnings since I can't see from where else it could
have gotten even a "struct of_device;" somewhere.

Do you have any idea Randy?  Pease try analyze this further so we can
fix it properly.

THanks!

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

* Re: linux-next: Tree for June 9 (niu)
  2010-06-09 18:06   ` David Miller
@ 2010-06-09 18:08     ` Randy Dunlap
  2010-06-09 22:44     ` [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled Randy Dunlap
  2010-06-09 22:44     ` [PATCH 2/2 -next] niu: always include of_device.h Randy Dunlap
  2 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2010-06-09 18:08 UTC (permalink / raw)
  To: David Miller; +Cc: sfr, netdev, linux-next, linux-kernel

On 06/09/10 11:06, David Miller wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> Date: Wed, 9 Jun 2010 10:36:57 -0700
> 
>> On Wed, 9 Jun 2010 13:34:43 +1000 Stephen Rothwell wrote:
>>
>>> Changes since 20100608:
>>>
>>> My fixes tree contains:
>>>       v4l-dvb: update gfp/slab.h includes
>>>       arm: update gfp/slab.h includes
>>>       davinci: update gfp/slab.h includes
>>>       ocfs2: update gfp/slab.h includes
>>>       acpi: update gfp/slab.h includes
>>
>>
>>
>> on x86_64 or i386, CONFIG_OF_DEVICE is not enabled:
>>
>> drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
>> drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
>> drivers/net/niu.c:9716: warning: assignment from incompatible pointer type
> 
> Hmmm, I'm confused why this never happened before :-)
> 
> We conditionalize linux/of_device.h inclusion with CONFIG_SPARC64, yet
> we unconditionally use "struct of_device *" pointers in the driver
> with no such ifdef protection.
> 
> Even if we unconditionally included linux/of_device.h, that file does
> nothing unless CONFIG_OF_DEVICE is defined so it should have always
> produced these warnings since I can't see from where else it could
> have gotten even a "struct of_device;" somewhere.
> 
> Do you have any idea Randy?  Pease try analyze this further so we can
> fix it properly.


I looked and was confuzed, but I'll look again.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled
  2010-06-09 18:06   ` David Miller
  2010-06-09 18:08     ` Randy Dunlap
@ 2010-06-09 22:44     ` Randy Dunlap
  2010-06-09 23:47       ` Grant Likely
  2010-06-09 22:44     ` [PATCH 2/2 -next] niu: always include of_device.h Randy Dunlap
  2 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2010-06-09 22:44 UTC (permalink / raw)
  To: David Miller, Grant Likely; +Cc: sfr, netdev, linux-next, linux-kernel

From: Randy Dunlap <randy.dunlap@oracle.com>

Drivers may use struct of_device (struct platform_device), even when
CONFIG_OF_DEVICE is not enabled, so minimally provide that struct
for that kconfig case.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Grant Likely <grant.likely@secretlab.ca>
Cc:	Dave Miller <davem@davemloft.net>
---
 include/linux/of_device.h |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-next-20100609.orig/include/linux/of_device.h
+++ linux-next-20100609/include/linux/of_device.h
@@ -47,6 +47,10 @@ extern ssize_t of_device_get_modalias(st
 
 extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
 
+#else
+
+#include <linux/platform_device.h>
+#define of_device platform_device
 
 #endif /* CONFIG_OF_DEVICE */
 

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

* [PATCH 2/2 -next] niu: always include of_device.h
  2010-06-09 18:06   ` David Miller
  2010-06-09 18:08     ` Randy Dunlap
  2010-06-09 22:44     ` [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled Randy Dunlap
@ 2010-06-09 22:44     ` Randy Dunlap
  2010-06-09 23:45       ` Grant Likely
  2 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2010-06-09 22:44 UTC (permalink / raw)
  To: David Miller, Grant Likely; +Cc: sfr, netdev, linux-next, linux-kernel

From: Randy Dunlap <randy.dunlap@oracle.com>

The niu driver uses struct of_device when built on any arch, not
only SPARC64, so always #include <linux/of_device.h>.

drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/niu.c:9716: warning: assignment from incompatible pointer type

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Grant Likely <grant.likely@secretlab.ca>
Cc:	Dave Miller <davem@davemloft.net>
---
 drivers/net/niu.c |    3 ---
 1 file changed, 3 deletions(-)

--- linux-next-20100609.orig/drivers/net/niu.c
+++ linux-next-20100609/drivers/net/niu.c
@@ -28,10 +28,7 @@
 #include <linux/slab.h>
 
 #include <linux/io.h>
-
-#ifdef CONFIG_SPARC64
 #include <linux/of_device.h>
-#endif
 
 #include "niu.h"
 

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

* Re: [PATCH 2/2 -next] niu: always include of_device.h
  2010-06-09 22:44     ` [PATCH 2/2 -next] niu: always include of_device.h Randy Dunlap
@ 2010-06-09 23:45       ` Grant Likely
  2010-06-10  0:29         ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2010-06-09 23:45 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: David Miller, sfr, netdev, linux-next, linux-kernel

On Wed, Jun 9, 2010 at 4:44 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> The niu driver uses struct of_device when built on any arch, not
> only SPARC64, so always #include <linux/of_device.h>.
>
> drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
> drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
> drivers/net/niu.c:9716: warning: assignment from incompatible pointer type
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> Cc:     Grant Likely <grant.likely@secretlab.ca>
> Cc:     Dave Miller <davem@davemloft.net>
> ---
>  drivers/net/niu.c |    3 ---

Looks okay to me (but I haven't build tested it yet).  The bulk of
of_device.h is compiled out when CONFIG_OF_DEVICE is not selected.

David, are you okay with me taking this via my tree as it depends on
Randy's other patch?

Thanks,
g.


>  1 file changed, 3 deletions(-)
>
> --- linux-next-20100609.orig/drivers/net/niu.c
> +++ linux-next-20100609/drivers/net/niu.c
> @@ -28,10 +28,7 @@
>  #include <linux/slab.h>
>
>  #include <linux/io.h>
> -
> -#ifdef CONFIG_SPARC64
>  #include <linux/of_device.h>
> -#endif
>
>  #include "niu.h"
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled
  2010-06-09 22:44     ` [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled Randy Dunlap
@ 2010-06-09 23:47       ` Grant Likely
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2010-06-09 23:47 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: David Miller, sfr, netdev, linux-next, linux-kernel

On Wed, Jun 9, 2010 at 4:44 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Drivers may use struct of_device (struct platform_device), even when
> CONFIG_OF_DEVICE is not enabled, so minimally provide that struct
> for that kconfig case.
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> Cc:     Grant Likely <grant.likely@secretlab.ca>
> Cc:     Dave Miller <davem@davemloft.net>
> ---
>  include/linux/of_device.h |    4 ++++
>  1 file changed, 4 insertions(+)
>
> --- linux-next-20100609.orig/include/linux/of_device.h
> +++ linux-next-20100609/include/linux/of_device.h
> @@ -47,6 +47,10 @@ extern ssize_t of_device_get_modalias(st
>
>  extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
>
> +#else
> +
> +#include <linux/platform_device.h>
> +#define of_device platform_device

I should probably just move these 2 lines out of the #if/else/endif
block entirely.  I'll make that change and test it out.

g.

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

* Re: [PATCH 2/2 -next] niu: always include of_device.h
  2010-06-09 23:45       ` Grant Likely
@ 2010-06-10  0:29         ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-06-10  0:29 UTC (permalink / raw)
  To: grant.likely; +Cc: randy.dunlap, sfr, netdev, linux-next, linux-kernel

From: Grant Likely <grant.likely@secretlab.ca>
Date: Wed, 9 Jun 2010 17:45:54 -0600

> On Wed, Jun 9, 2010 at 4:44 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> The niu driver uses struct of_device when built on any arch, not
>> only SPARC64, so always #include <linux/of_device.h>.
>>
>> drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
>> drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
>> drivers/net/niu.c:9716: warning: assignment from incompatible pointer type
>>
>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>> Cc:     Grant Likely <grant.likely@secretlab.ca>
>> Cc:     Dave Miller <davem@davemloft.net>
>> ---
>>  drivers/net/niu.c |    3 ---
> 
> Looks okay to me (but I haven't build tested it yet).  The bulk of
> of_device.h is compiled out when CONFIG_OF_DEVICE is not selected.
> 
> David, are you okay with me taking this via my tree as it depends on
> Randy's other patch?

Yep, that's totally fine with me:

Acked-by: David S. Miller <davem@davemloft.net>

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

end of thread, other threads:[~2010-06-10  0:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100609133443.38f1f957.sfr@canb.auug.org.au>
2010-06-09 17:36 ` linux-next: Tree for June 9 (niu) Randy Dunlap
2010-06-09 18:06   ` David Miller
2010-06-09 18:08     ` Randy Dunlap
2010-06-09 22:44     ` [PATCH 1/2 -next] of_device.h: provide struct of_device even when not enabled Randy Dunlap
2010-06-09 23:47       ` Grant Likely
2010-06-09 22:44     ` [PATCH 2/2 -next] niu: always include of_device.h Randy Dunlap
2010-06-09 23:45       ` Grant Likely
2010-06-10  0:29         ` David Miller

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).