devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
@ 2013-02-18 23:58 Sergei Shtylyov
  2013-03-01  7:09 ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2013-02-18 23:58 UTC (permalink / raw)
  To: grant.likely, rob.herring, devicetree-discuss
  Cc: vladimir.barinov, linux-sh, linux-kernel

Fix the following compilation warnings (in Simon Horman's renesas.git repo):

In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
inside parameter list [enabled by default]
include/linux/of_platform.h:107:13: warning: its scope is only this definition
or declaration, which is probably not what you want [enabled by default]
include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
inside parameter list [enabled by default]

<linux/of_platform.h> only #include's headers with definitions of the above
mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
incomplete declarations for the rest of the structures where the #ifdef move
doesn't help...

Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
Actually, it compiles eve without 'struct device_node' declared, I haven't
found the reason of this, so left it there...

 include/linux/of_platform.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux/include/linux/of_platform.h
===================================================================
--- linux.orig/include/linux/of_platform.h
+++ linux/include/linux/of_platform.h
@@ -11,9 +11,10 @@
  *
  */
 
-#ifdef CONFIG_OF_DEVICE
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
+
+#ifdef CONFIG_OF_DEVICE
 #include <linux/pm.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -100,7 +101,7 @@ extern int of_platform_populate(struct d
 
 #if !defined(CONFIG_OF_ADDRESS)
 struct of_dev_auxdata;
-struct device;
+struct device_node;
 static inline int of_platform_populate(struct device_node *root,
 					const struct of_device_id *matches,
 					const struct of_dev_auxdata *lookup,

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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-02-18 23:58 [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled Sergei Shtylyov
@ 2013-03-01  7:09 ` Simon Horman
  2013-03-01 13:46   ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2013-03-01  7:09 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: grant.likely, rob.herring, devicetree-discuss, vladimir.barinov,
	linux-sh, linux-kernel

On Tue, Feb 19, 2013 at 02:58:25AM +0300, Sergei Shtylyov wrote:
> Fix the following compilation warnings (in Simon Horman's renesas.git repo):
> 
> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
> inside parameter list [enabled by default]
> include/linux/of_platform.h:107:13: warning: its scope is only this definition
> or declaration, which is probably not what you want [enabled by default]
> include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
> inside parameter list [enabled by default]
> 
> <linux/of_platform.h> only #include's headers with definitions of the above
> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
> incomplete declarations for the rest of the structures where the #ifdef move
> doesn't help...
> 
> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

Grant, could you consider taking this patch?

> ---
> Actually, it compiles eve without 'struct device_node' declared, I haven't
> found the reason of this, so left it there...
> 
>  include/linux/of_platform.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Index: linux/include/linux/of_platform.h
> ===================================================================
> --- linux.orig/include/linux/of_platform.h
> +++ linux/include/linux/of_platform.h
> @@ -11,9 +11,10 @@
>   *
>   */
>  
> -#ifdef CONFIG_OF_DEVICE
>  #include <linux/device.h>
>  #include <linux/mod_devicetable.h>
> +
> +#ifdef CONFIG_OF_DEVICE
>  #include <linux/pm.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
> @@ -100,7 +101,7 @@ extern int of_platform_populate(struct d
>  
>  #if !defined(CONFIG_OF_ADDRESS)
>  struct of_dev_auxdata;
> -struct device;
> +struct device_node;
>  static inline int of_platform_populate(struct device_node *root,
>  					const struct of_device_id *matches,
>  					const struct of_dev_auxdata *lookup,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-03-01  7:09 ` Simon Horman
@ 2013-03-01 13:46   ` Rob Herring
  2013-03-01 13:48     ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2013-03-01 13:46 UTC (permalink / raw)
  To: Simon Horman, Sergei Shtylyov
  Cc: linux-sh, devicetree-discuss, linux-kernel, rob.herring,
	vladimir.barinov

On 03/01/2013 01:09 AM, Simon Horman wrote:
> On Tue, Feb 19, 2013 at 02:58:25AM +0300, Sergei Shtylyov wrote:
>> Fix the following compilation warnings (in Simon Horman's renesas.git repo):
>>
>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
>> inside parameter list [enabled by default]
>> include/linux/of_platform.h:107:13: warning: its scope is only this definition
>> or declaration, which is probably not what you want [enabled by default]
>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
>> inside parameter list [enabled by default]
>>
>> <linux/of_platform.h> only #include's headers with definitions of the above
>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
>> incomplete declarations for the rest of the structures where the #ifdef move
>> doesn't help...
>>
>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Grant, could you consider taking this patch?

Yes, I can, but I don't seem to have the original patch. Can you send it
again.

>> ---
>> Actually, it compiles eve without 'struct device_node' declared, I haven't
>> found the reason of this, so left it there...

device.h has a forward declaration of it.

Rob

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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-03-01 13:46   ` Rob Herring
@ 2013-03-01 13:48     ` Rob Herring
  2013-03-01 13:55       ` Sergei Shtylyov
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2013-03-01 13:48 UTC (permalink / raw)
  To: Simon Horman, Sergei Shtylyov
  Cc: linux-sh, devicetree-discuss, linux-kernel, rob.herring,
	vladimir.barinov

On 03/01/2013 07:46 AM, Rob Herring wrote:
> On 03/01/2013 01:09 AM, Simon Horman wrote:
>> On Tue, Feb 19, 2013 at 02:58:25AM +0300, Sergei Shtylyov wrote:
>>> Fix the following compilation warnings (in Simon Horman's renesas.git repo):
>>>
>>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
>>> inside parameter list [enabled by default]
>>> include/linux/of_platform.h:107:13: warning: its scope is only this definition
>>> or declaration, which is probably not what you want [enabled by default]
>>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
>>> inside parameter list [enabled by default]
>>>
>>> <linux/of_platform.h> only #include's headers with definitions of the above
>>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
>>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
>>> incomplete declarations for the rest of the structures where the #ifdef move
>>> doesn't help...
>>>
>>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>>
>> Grant, could you consider taking this patch?
> 
> Yes, I can, but I don't seem to have the original patch. Can you send it
> again.

Nevermind. Found it. I'll apply it.

Rob


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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-03-01 13:48     ` Rob Herring
@ 2013-03-01 13:55       ` Sergei Shtylyov
  2013-03-01 14:02         ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2013-03-01 13:55 UTC (permalink / raw)
  To: Rob Herring
  Cc: Simon Horman, linux-sh, devicetree-discuss, linux-kernel,
	rob.herring, vladimir.barinov

Hello.

On 01-03-2013 17:48, Rob Herring wrote:

>>>> Fix the following compilation warnings (in Simon Horman's renesas.git repo):

>>>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>>>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
>>>> inside parameter list [enabled by default]
>>>> include/linux/of_platform.h:107:13: warning: its scope is only this definition
>>>> or declaration, which is probably not what you want [enabled by default]
>>>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
>>>> inside parameter list [enabled by default]

>>>> <linux/of_platform.h> only #include's headers with definitions of the above
>>>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
>>>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
>>>> incomplete declarations for the rest of the structures where the #ifdef move
>>>> doesn't help...

>>>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

>>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

>>> Grant, could you consider taking this patch?

>> Yes, I can, but I don't seem to have the original patch. Can you send it
>> again.

> Nevermind. Found it. I'll apply it.

    Will you drop 'struct device_node' declaration then or should I resend? In 
fact, I think I should better resend it with the changelog somewhat edited.

> Rob

WBR, Sergei


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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-03-01 13:55       ` Sergei Shtylyov
@ 2013-03-01 14:02         ` Rob Herring
  2013-05-16 20:58           ` Sergei Shtylyov
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2013-03-01 14:02 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Simon Horman, linux-sh, devicetree-discuss, linux-kernel,
	rob.herring, vladimir.barinov

On 03/01/2013 07:55 AM, Sergei Shtylyov wrote:
> Hello.
> 
> On 01-03-2013 17:48, Rob Herring wrote:
> 
>>>>> Fix the following compilation warnings (in Simon Horman's
>>>>> renesas.git repo):
> 
>>>>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>>>>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’
>>>>> declared
>>>>> inside parameter list [enabled by default]
>>>>> include/linux/of_platform.h:107:13: warning: its scope is only this
>>>>> definition
>>>>> or declaration, which is probably not what you want [enabled by
>>>>> default]
>>>>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’
>>>>> declared
>>>>> inside parameter list [enabled by default]
> 
>>>>> <linux/of_platform.h> only #include's headers with definitions of
>>>>> the above
>>>>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if
>>>>> not. One
>>>>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE
>>>>> and use
>>>>> incomplete declarations for the rest of the structures where the
>>>>> #ifdef move
>>>>> doesn't help...
> 
>>>>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
>>>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> 
>>>> Grant, could you consider taking this patch?
> 
>>> Yes, I can, but I don't seem to have the original patch. Can you send it
>>> again.
> 
>> Nevermind. Found it. I'll apply it.
> 
>    Will you drop 'struct device_node' declaration then or should I
> resend? In fact, I think I should better resend it with the changelog
> somewhat edited.

No, I plan to leave it as is and not rely on device.h by chance
declaring device_node.

Rob

> 
>> Rob
> 
> WBR, Sergei
> 


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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-03-01 14:02         ` Rob Herring
@ 2013-05-16 20:58           ` Sergei Shtylyov
  2013-05-16 22:44             ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2013-05-16 20:58 UTC (permalink / raw)
  To: Rob Herring
  Cc: Simon Horman, linux-sh, devicetree-discuss, linux-kernel,
	rob.herring, vladimir.barinov

Hello.

On 03/01/2013 05:02 PM, Rob Herring wrote:

>>>>>> Fix the following compilation warnings (in Simon Horman's
>>>>>> renesas.git repo):
>>>>>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>>>>>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’
>>>>>> declared
>>>>>> inside parameter list [enabled by default]
>>>>>> include/linux/of_platform.h:107:13: warning: its scope is only this
>>>>>> definition
>>>>>> or declaration, which is probably not what you want [enabled by
>>>>>> default]
>>>>>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’
>>>>>> declared
>>>>>> inside parameter list [enabled by default]
>>>>>> <linux/of_platform.h> only #include's headers with definitions of
>>>>>> the above
>>>>>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if
>>>>>> not. One
>>>>>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE
>>>>>> and use
>>>>>> incomplete declarations for the rest of the structures where the
>>>>>> #ifdef move
>>>>>> doesn't help...
>>>>>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>>>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>>>>> Grant, could you consider taking this patch?
>>>> Yes, I can, but I don't seem to have the original patch. Can you send it
>>>> again.
>>> Nevermind. Found it. I'll apply it.
>>     Will you drop 'struct device_node' declaration then or should I
>> resend? In fact, I think I should better resend it with the changelog
>> somewhat edited.
> No, I plan to leave it as is and not rely on device.h by chance
> declaring device_node.

     I hoped to see this fix in 3.10-rc1. Is there any hope to see it in 
3.10-rc's?
The code it fixes the warnings in is already in Linus tree.

>
>>> Rob

WBR, Sergei


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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-05-16 20:58           ` Sergei Shtylyov
@ 2013-05-16 22:44             ` Rob Herring
  2013-05-17 16:49               ` Grant Likely
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2013-05-16 22:44 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Simon Horman, linux-sh, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, Rob Herring, vladimir.barinov

On Thu, May 16, 2013 at 3:58 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
>
> On 03/01/2013 05:02 PM, Rob Herring wrote:
>
>>>>>>> Fix the following compilation warnings (in Simon Horman's
>>>>>>> renesas.git repo):
>>>>>>> In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
>>>>>>> include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’
>>>>>>> declared
>>>>>>> inside parameter list [enabled by default]
>>>>>>> include/linux/of_platform.h:107:13: warning: its scope is only this
>>>>>>> definition
>>>>>>> or declaration, which is probably not what you want [enabled by
>>>>>>> default]
>>>>>>> include/linux/of_platform.h:107:13: warning: ‘struct device_node’
>>>>>>> declared
>>>>>>> inside parameter list [enabled by default]
>>>>>>> <linux/of_platform.h> only #include's headers with definitions of
>>>>>>> the above
>>>>>>> mentioned structures if CONFIG_OF_DEVICE=y but uses them even if
>>>>>>> not. One
>>>>>>> solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE
>>>>>>> and use
>>>>>>> incomplete declarations for the rest of the structures where the
>>>>>>> #ifdef move
>>>>>>> doesn't help...
>>>>>>> Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
>>>>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>>>>
>>>>>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>>>>>> Grant, could you consider taking this patch?
>>>>>
>>>>> Yes, I can, but I don't seem to have the original patch. Can you send
>>>>> it
>>>>> again.
>>>>
>>>> Nevermind. Found it. I'll apply it.
>>>
>>>     Will you drop 'struct device_node' declaration then or should I
>>> resend? In fact, I think I should better resend it with the changelog
>>> somewhat edited.
>>
>> No, I plan to leave it as is and not rely on device.h by chance
>> declaring device_node.
>
>
>     I hoped to see this fix in 3.10-rc1. Is there any hope to see it in
> 3.10-rc's?
> The code it fixes the warnings in is already in Linus tree.

So I had this queued up, but Grant did not send DT update to Linus for
3.10. The main thing we had was the preprocessor support and that went
thru arm-soc tree. I plan to send this and other fixes to Linus for
3.10.

Rob

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

* Re: [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled
  2013-05-16 22:44             ` Rob Herring
@ 2013-05-17 16:49               ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2013-05-17 16:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: Sergei Shtylyov, Simon Horman, linux-sh@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Rob Herring, vladimir.barinov

On Thu, May 16, 2013 at 11:44 PM, Rob Herring <robherring2@gmail.com> wrote:
>>     I hoped to see this fix in 3.10-rc1. Is there any hope to see it in
>> 3.10-rc's?
>> The code it fixes the warnings in is already in Linus tree.
>
> So I had this queued up, but Grant did not send DT update to Linus for
> 3.10. The main thing we had was the preprocessor support and that went
> thru arm-soc tree. I plan to send this and other fixes to Linus for
> 3.10.

I got gun shy from the gpio stuff and fixated on better testing of my
tree. Everything in my tree is bug fixes so I'll be sending the pull
request today

g.

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

end of thread, other threads:[~2013-05-17 16:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-18 23:58 [PATCH] <linux/of_platform.h>: fix compilation warnings with DT disabled Sergei Shtylyov
2013-03-01  7:09 ` Simon Horman
2013-03-01 13:46   ` Rob Herring
2013-03-01 13:48     ` Rob Herring
2013-03-01 13:55       ` Sergei Shtylyov
2013-03-01 14:02         ` Rob Herring
2013-05-16 20:58           ` Sergei Shtylyov
2013-05-16 22:44             ` Rob Herring
2013-05-17 16:49               ` Grant Likely

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