public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: core: add missing header dependencies
@ 2016-09-01 11:37 Baoyou Xie
  2016-09-01 13:33 ` kbuild test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2016-09-01 11:37 UTC (permalink / raw)
  To: gregkh, arnd, robh, p.zabel, peter.chen
  Cc: linux-usb, linux-kernel, baoyou.xie, xie.baoyou

We get 1 warning when building kernel with W=1:
drivers/usb/core/of.c:31:21: warning: no previous prototype for 'usb_of_get_child_node' [-Wmissing-prototypes]

In fact, this function is declared in linux/usb/of.h, so this patch
add missing header dependencies

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.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.7.4

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

* Re: [PATCH] USB: core: add missing header dependencies
  2016-09-01 11:37 [PATCH] USB: core: add missing header dependencies Baoyou Xie
@ 2016-09-01 13:33 ` kbuild test robot
  2016-09-01 13:45   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2016-09-01 13:33 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: kbuild-all, gregkh, arnd, robh, p.zabel, peter.chen, linux-usb,
	linux-kernel, baoyou.xie, xie.baoyou

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

Hi Baoyou,

[auto build test ERROR on arm-soc/for-next]
[also build test ERROR on v4.8-rc4]
[cannot apply to usb/usb-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Baoyou-Xie/USB-core-add-missing-header-dependencies/20160901-194228
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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: 37605 bytes --]

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

* Re: [PATCH] USB: core: add missing header dependencies
  2016-09-01 13:33 ` kbuild test robot
@ 2016-09-01 13:45   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-09-01 13:45 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Baoyou Xie, kbuild-all, gregkh, robh, p.zabel, peter.chen,
	linux-usb, linux-kernel, xie.baoyou

On Thursday, September 1, 2016 9:33:59 PM CEST kbuild test robot wrote:
> Hi Baoyou,
> 
> [auto build test ERROR on arm-soc/for-next]
> [also build test ERROR on v4.8-rc4]
> [cannot apply to usb/usb-testing next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
> 

We already have a correct version of this patch in linux-next, see
below.

	Arnd


commit 0573f2c519e570d056989e57565e1ff1640dd794
Author: Peter Chen <peter.chen@nxp.com>
Date:   Wed Jun 15 11:25:43 2016 +0800

    usb: core: of.c: fix defined but not declare warning
    
    The helper usb_of_get_child_node is defined at of.c, but missing its
    declare as a global function. Fix it by adding related header file
    as well as compile it on conditional of CONFIG_OF.
    
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Cc: linux-usb@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Ben Dooks <ben.dooks@codethink.co.uk>
    Cc: linux-kernel@lists.codethink.co.uk
    
    Signed-off-by: Peter Chen <peter.chen@nxp.com>
    Reported-by: Ben Dooks <ben.dooks@codethink.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile
index 9780877010b4..da36b784a0ef 100644
--- a/drivers/usb/core/Makefile
+++ b/drivers/usb/core/Makefile
@@ -5,8 +5,9 @@
 usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
 usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
 usbcore-y += devio.o notify.o generic.o quirks.o devices.o
-usbcore-y += port.o of.o
+usbcore-y += port.o
 
+usbcore-$(CONFIG_OF)		+= of.o
 usbcore-$(CONFIG_PCI)		+= hcd-pci.o
 usbcore-$(CONFIG_ACPI)		+= usb-acpi.o
 
diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c
index 2289700c31d6..3de4f8873984 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

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

end of thread, other threads:[~2016-09-01 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 11:37 [PATCH] USB: core: add missing header dependencies Baoyou Xie
2016-09-01 13:33 ` kbuild test robot
2016-09-01 13:45   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox