linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: core: fix missing include <linux/usb/of.h>
@ 2016-06-07 18:20 Ben Dooks
  2016-06-07 19:04 ` kbuild test robot
  2016-06-14  1:34 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 8+ messages in thread
From: Ben Dooks @ 2016-06-07 18:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ben Dooks, Greg Kroah-Hartman, Arnd Bergmann, Philipp Zabel,
	Alan Stern, Peter Chen, linux-usb, linux-kernel

The helper function usb_of_get_child_node() is defined in the
header <linux/usb/of.h> but this was not included. Fix the warning
about usb_of_get_child_node() not being declared by adding the
right include. Fixes:

drivers/usb/core/of.c:31:20: warning: symbol 'usb_of_get_child_node' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Peter Chen <peter.chen@freescale.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/usb/core/of.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c
index 2289700..3de4f88 100644
--- a/drivers/usb/core/of.c
+++ b/drivers/usb/core/of.c
@@ -18,6 +18,7 @@
  */
 
 #include <linux/of.h>
+#include <linux/usb/of.h>
 
 /**
  * usb_of_get_child_node - Find the device node match port number
-- 
2.8.1

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-07 18:20 [PATCH] USB: core: fix missing include <linux/usb/of.h> Ben Dooks
@ 2016-06-07 19:04 ` kbuild test robot
  2016-06-14 11:08   ` Arnd Bergmann
  2016-06-14  1:34 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 8+ messages in thread
From: kbuild test robot @ 2016-06-07 19:04 UTC (permalink / raw)
  To: Ben Dooks
  Cc: kbuild-all, linux-kernel, Ben Dooks, Greg Kroah-Hartman,
	Arnd Bergmann, Philipp Zabel, Alan Stern, Peter Chen, linux-usb,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]

Hi,

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v4.7-rc2 next-20160607]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ben-Dooks/USB-core-fix-missing-include-linux-usb-of-h/20160608-022844
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: i386-defconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
    struct device_node *usb_of_get_child_node(struct device_node *parent,
                        ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/usb/core/of.c:21:0:
   include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
    static inline struct device_node *usb_of_get_child_node
                                      ^~~~~~~~~~~~~~~~~~~~~

vim +/usb_of_get_child_node +32 drivers/usb/core/of.c

69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
69bec725 Peter Chen 2016-02-19  27   *
69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
69bec725 Peter Chen 2016-02-19  29   *
69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
69bec725 Peter Chen 2016-02-19  31   */
69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
69bec725 Peter Chen 2016-02-19  33  					int portnum)
69bec725 Peter Chen 2016-02-19  34  {
69bec725 Peter Chen 2016-02-19  35  	struct device_node *node;

:::::: The code at line 32 was first introduced by commit
:::::: 69bec725985324e79b1c47ea287815ac4ddb0521 USB: core: let USB device know device node

:::::: TO: Peter Chen <peter.chen@freescale.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24879 bytes --]

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-07 18:20 [PATCH] USB: core: fix missing include <linux/usb/of.h> Ben Dooks
  2016-06-07 19:04 ` kbuild test robot
@ 2016-06-14  1:34 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2016-06-14  1:34 UTC (permalink / raw)
  To: Ben Dooks
  Cc: linux-kernel, Arnd Bergmann, Philipp Zabel, Alan Stern,
	Peter Chen, linux-usb, linux-kernel

On Tue, Jun 07, 2016 at 07:20:33PM +0100, Ben Dooks wrote:
> The helper function usb_of_get_child_node() is defined in the
> header <linux/usb/of.h> but this was not included. Fix the warning
> about usb_of_get_child_node() not being declared by adding the
> right include. Fixes:
> 
> drivers/usb/core/of.c:31:20: warning: symbol 'usb_of_get_child_node' was not declared. Should it be static?
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Given that the kbuild robot broke with this patch, I'm not going to take
it...

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-07 19:04 ` kbuild test robot
@ 2016-06-14 11:08   ` Arnd Bergmann
  2016-06-15  2:43     ` Peter Chen
  2016-06-16 13:02     ` Ben Dooks
  0 siblings, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2016-06-14 11:08 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Ben Dooks, kbuild-all, linux-kernel, Greg Kroah-Hartman,
	Philipp Zabel, Alan Stern, Peter Chen, linux-usb, linux-kernel

On Wednesday, June 8, 2016 3:04:27 AM CEST kbuild test robot wrote:
> >> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
>     struct device_node *usb_of_get_child_node(struct device_node *parent,
>                         ^~~~~~~~~~~~~~~~~~~~~
>    In file included from drivers/usb/core/of.c:21:0:
>    include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
>     static inline struct device_node *usb_of_get_child_node
>                                       ^~~~~~~~~~~~~~~~~~~~~
> 
> vim +/usb_of_get_child_node +32 drivers/usb/core/of.c
> 
> 69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
> 69bec725 Peter Chen 2016-02-19  27   *
> 69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
> 69bec725 Peter Chen 2016-02-19  29   *
> 69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
> 69bec725 Peter Chen 2016-02-19  31   */
> 69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
> 69bec725 Peter Chen 2016-02-19  33                                      int portnum)
> 69bec725 Peter Chen 2016-02-19  34  {
> 69bec725 Peter Chen 2016-02-19  35      struct device_node *node;
> 
> 

I think what we want here is to make the compilation of of.o conditional on
CONFIG_OF, so we get only one of the two definitions.

	Arnd

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-14 11:08   ` Arnd Bergmann
@ 2016-06-15  2:43     ` Peter Chen
  2016-06-16 12:45       ` Ben Dooks
  2016-06-16 13:02     ` Ben Dooks
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Chen @ 2016-06-15  2:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild test robot, Ben Dooks, kbuild-all, linux-kernel,
	Greg Kroah-Hartman, Philipp Zabel, Alan Stern, Peter Chen,
	linux-usb, linux-kernel

On Tue, Jun 14, 2016 at 01:08:08PM +0200, Arnd Bergmann wrote:
> On Wednesday, June 8, 2016 3:04:27 AM CEST kbuild test robot wrote:
> > >> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
> >     struct device_node *usb_of_get_child_node(struct device_node *parent,
> >                         ^~~~~~~~~~~~~~~~~~~~~
> >    In file included from drivers/usb/core/of.c:21:0:
> >    include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
> >     static inline struct device_node *usb_of_get_child_node
> >                                       ^~~~~~~~~~~~~~~~~~~~~
> > 
> > vim +/usb_of_get_child_node +32 drivers/usb/core/of.c
> > 
> > 69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
> > 69bec725 Peter Chen 2016-02-19  27   *
> > 69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
> > 69bec725 Peter Chen 2016-02-19  29   *
> > 69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
> > 69bec725 Peter Chen 2016-02-19  31   */
> > 69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
> > 69bec725 Peter Chen 2016-02-19  33                                      int portnum)
> > 69bec725 Peter Chen 2016-02-19  34  {
> > 69bec725 Peter Chen 2016-02-19  35      struct device_node *node;
> > 
> > 
> 
> I think what we want here is to make the compilation of of.o conditional on
> CONFIG_OF, so we get only one of the two definitions.
> 
> 	Arnd

Thanks, Arnd. It is the correct solution, I will send patch soon.

-- 

Best Regards,
Peter Chen

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-15  2:43     ` Peter Chen
@ 2016-06-16 12:45       ` Ben Dooks
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Dooks @ 2016-06-16 12:45 UTC (permalink / raw)
  To: Peter Chen, Arnd Bergmann
  Cc: kbuild test robot, kbuild-all, linux-kernel, Greg Kroah-Hartman,
	Philipp Zabel, Alan Stern, Peter Chen, linux-usb, linux-kernel

On 15/06/16 03:43, Peter Chen wrote:
> On Tue, Jun 14, 2016 at 01:08:08PM +0200, Arnd Bergmann wrote:
>> On Wednesday, June 8, 2016 3:04:27 AM CEST kbuild test robot wrote:
>>>>> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
>>>     struct device_node *usb_of_get_child_node(struct device_node *parent,
>>>                         ^~~~~~~~~~~~~~~~~~~~~
>>>    In file included from drivers/usb/core/of.c:21:0:
>>>    include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
>>>     static inline struct device_node *usb_of_get_child_node
>>>                                       ^~~~~~~~~~~~~~~~~~~~~
>>>
>>> vim +/usb_of_get_child_node +32 drivers/usb/core/of.c
>>>
>>> 69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
>>> 69bec725 Peter Chen 2016-02-19  27   *
>>> 69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
>>> 69bec725 Peter Chen 2016-02-19  29   *
>>> 69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
>>> 69bec725 Peter Chen 2016-02-19  31   */
>>> 69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
>>> 69bec725 Peter Chen 2016-02-19  33                                      int portnum)
>>> 69bec725 Peter Chen 2016-02-19  34  {
>>> 69bec725 Peter Chen 2016-02-19  35      struct device_node *node;
>>>
>>>
>>
>> I think what we want here is to make the compilation of of.o conditional on
>> CONFIG_OF, so we get only one of the two definitions.
>>
>> 	Arnd
> 
> Thanks, Arnd. It is the correct solution, I will send patch soon.

Aha, I didn't think of that. Thanks.


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-14 11:08   ` Arnd Bergmann
  2016-06-15  2:43     ` Peter Chen
@ 2016-06-16 13:02     ` Ben Dooks
  2016-06-17  1:31       ` Peter Chen
  1 sibling, 1 reply; 8+ messages in thread
From: Ben Dooks @ 2016-06-16 13:02 UTC (permalink / raw)
  To: Arnd Bergmann, kbuild test robot
  Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman, Philipp Zabel,
	Alan Stern, Peter Chen, linux-usb, linux-kernel

On 14/06/16 12:08, Arnd Bergmann wrote:
> On Wednesday, June 8, 2016 3:04:27 AM CEST kbuild test robot wrote:
>>>> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
>>     struct device_node *usb_of_get_child_node(struct device_node *parent,
>>                         ^~~~~~~~~~~~~~~~~~~~~
>>    In file included from drivers/usb/core/of.c:21:0:
>>    include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
>>     static inline struct device_node *usb_of_get_child_node
>>                                       ^~~~~~~~~~~~~~~~~~~~~
>>
>> vim +/usb_of_get_child_node +32 drivers/usb/core/of.c
>>
>> 69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
>> 69bec725 Peter Chen 2016-02-19  27   *
>> 69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
>> 69bec725 Peter Chen 2016-02-19  29   *
>> 69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
>> 69bec725 Peter Chen 2016-02-19  31   */
>> 69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
>> 69bec725 Peter Chen 2016-02-19  33                                      int portnum)
>> 69bec725 Peter Chen 2016-02-19  34  {
>> 69bec725 Peter Chen 2016-02-19  35      struct device_node *node;
>>
>>
> 
> I think what we want here is to make the compilation of of.o conditional on
> CONFIG_OF, so we get only one of the two definitions.

Ah, so make the of.o conditional, and also apply my patch for when
it is compiled.

Should I submit one for that, or is someone else on the case?

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [PATCH] USB: core: fix missing include <linux/usb/of.h>
  2016-06-16 13:02     ` Ben Dooks
@ 2016-06-17  1:31       ` Peter Chen
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Chen @ 2016-06-17  1:31 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Arnd Bergmann, kbuild test robot, kbuild-all, linux-kernel,
	Greg Kroah-Hartman, Philipp Zabel, Alan Stern, Peter Chen,
	linux-usb, linux-kernel

On Thu, Jun 16, 2016 at 02:02:37PM +0100, Ben Dooks wrote:
> On 14/06/16 12:08, Arnd Bergmann wrote:
> > On Wednesday, June 8, 2016 3:04:27 AM CEST kbuild test robot wrote:
> >>>> drivers/usb/core/of.c:32:21: error: redefinition of 'usb_of_get_child_node'
> >>     struct device_node *usb_of_get_child_node(struct device_node *parent,
> >>                         ^~~~~~~~~~~~~~~~~~~~~
> >>    In file included from drivers/usb/core/of.c:21:0:
> >>    include/linux/usb/of.h:36:35: note: previous definition of 'usb_of_get_child_node' was here
> >>     static inline struct device_node *usb_of_get_child_node
> >>                                       ^~~~~~~~~~~~~~~~~~~~~
> >>
> >> vim +/usb_of_get_child_node +32 drivers/usb/core/of.c
> >>
> >> 69bec725 Peter Chen 2016-02-19  26   * @portnum: the port number which device is connecting
> >> 69bec725 Peter Chen 2016-02-19  27   *
> >> 69bec725 Peter Chen 2016-02-19  28   * Find the node from device tree according to its port number.
> >> 69bec725 Peter Chen 2016-02-19  29   *
> >> 69bec725 Peter Chen 2016-02-19  30   * Return: On success, a pointer to the device node, %NULL on failure.
> >> 69bec725 Peter Chen 2016-02-19  31   */
> >> 69bec725 Peter Chen 2016-02-19 @32  struct device_node *usb_of_get_child_node(struct device_node *parent,
> >> 69bec725 Peter Chen 2016-02-19  33                                      int portnum)
> >> 69bec725 Peter Chen 2016-02-19  34  {
> >> 69bec725 Peter Chen 2016-02-19  35      struct device_node *node;
> >>
> >>
> > 
> > I think what we want here is to make the compilation of of.o conditional on
> > CONFIG_OF, so we get only one of the two definitions.
> 
> Ah, so make the of.o conditional, and also apply my patch for when
> it is compiled.
> 
> Should I submit one for that, or is someone else on the case?
> 

Yes, Ben. I have already done it.

http://www.spinics.net/lists/linux-usb/msg142676.html

-- 

Best Regards,
Peter Chen

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

end of thread, other threads:[~2016-06-17  1:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 18:20 [PATCH] USB: core: fix missing include <linux/usb/of.h> Ben Dooks
2016-06-07 19:04 ` kbuild test robot
2016-06-14 11:08   ` Arnd Bergmann
2016-06-15  2:43     ` Peter Chen
2016-06-16 12:45       ` Ben Dooks
2016-06-16 13:02     ` Ben Dooks
2016-06-17  1:31       ` Peter Chen
2016-06-14  1:34 ` Greg Kroah-Hartman

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