linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbip: tools: fix build error for multiple definition
@ 2020-06-18  0:08 Antonio Borneo
  2020-06-18 17:36 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Borneo @ 2020-06-18  0:08 UTC (permalink / raw)
  To: Valentina Manea, Shuah Khan, Greg Kroah-Hartman, Hewenliang, linux-usb
  Cc: Antonio Borneo, linux-kernel

With GCC 10, building usbip triggers error for multiple definition
of 'udev_context', in:
- libsrc/vhci_driver.c:18 and
- libsrc/usbip_host_common.c:27.

Declare as extern the definition in libsrc/usbip_host_common.c.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
---
 tools/usb/usbip/libsrc/usbip_host_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c
index d1d8ba2a4a40..ca78aa368476 100644
--- a/tools/usb/usbip/libsrc/usbip_host_common.c
+++ b/tools/usb/usbip/libsrc/usbip_host_common.c
@@ -23,7 +23,7 @@
 #include "list.h"
 #include "sysfs_utils.h"
 
-struct udev *udev_context;
+extern struct udev *udev_context;
 
 static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
 {
-- 
2.27.0


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

* Re: [PATCH] usbip: tools: fix build error for multiple definition
  2020-06-18  0:08 [PATCH] usbip: tools: fix build error for multiple definition Antonio Borneo
@ 2020-06-18 17:36 ` Shuah Khan
  2020-07-23 22:58   ` Salvatore Bonaccorso
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2020-06-18 17:36 UTC (permalink / raw)
  To: Antonio Borneo, Valentina Manea, Shuah Khan, Greg Kroah-Hartman,
	Hewenliang, linux-usb
  Cc: linux-kernel, skhan

On 6/17/20 6:08 PM, Antonio Borneo wrote:
> With GCC 10, building usbip triggers error for multiple definition
> of 'udev_context', in:
> - libsrc/vhci_driver.c:18 and
> - libsrc/usbip_host_common.c:27.
> 
> Declare as extern the definition in libsrc/usbip_host_common.c.
> 
> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
> ---
>   tools/usb/usbip/libsrc/usbip_host_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c
> index d1d8ba2a4a40..ca78aa368476 100644
> --- a/tools/usb/usbip/libsrc/usbip_host_common.c
> +++ b/tools/usb/usbip/libsrc/usbip_host_common.c
> @@ -23,7 +23,7 @@
>   #include "list.h"
>   #include "sysfs_utils.h"
>   
> -struct udev *udev_context;
> +extern struct udev *udev_context;
>   
>   static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
>   {
> 

Looks good to me.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah

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

* Re: [PATCH] usbip: tools: fix build error for multiple definition
  2020-06-18 17:36 ` Shuah Khan
@ 2020-07-23 22:58   ` Salvatore Bonaccorso
  0 siblings, 0 replies; 3+ messages in thread
From: Salvatore Bonaccorso @ 2020-07-23 22:58 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Antonio Borneo, Valentina Manea, Shuah Khan, Greg Kroah-Hartman,
	Hewenliang, linux-usb, linux-kernel

Hi,

On Thu, Jun 18, 2020 at 11:36:39AM -0600, Shuah Khan wrote:
> On 6/17/20 6:08 PM, Antonio Borneo wrote:
> > With GCC 10, building usbip triggers error for multiple definition
> > of 'udev_context', in:
> > - libsrc/vhci_driver.c:18 and
> > - libsrc/usbip_host_common.c:27.
> > 
> > Declare as extern the definition in libsrc/usbip_host_common.c.
> > 
> > Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
> > ---
> >   tools/usb/usbip/libsrc/usbip_host_common.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c
> > index d1d8ba2a4a40..ca78aa368476 100644
> > --- a/tools/usb/usbip/libsrc/usbip_host_common.c
> > +++ b/tools/usb/usbip/libsrc/usbip_host_common.c
> > @@ -23,7 +23,7 @@
> >   #include "list.h"
> >   #include "sysfs_utils.h"
> > -struct udev *udev_context;
> > +extern struct udev *udev_context;
> >   static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
> >   {
> > 
> 
> Looks good to me.
> 
> Acked-by: Shuah Khan <skhan@linuxfoundation.org>

As Debian (unstable) has switched to GCC 10 by default, we are biten
by this. Patch looks good to me.

Tested-by: Salvatore Bonaccorso <carnil@debian.org>

Regards,
Salvatore

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

end of thread, other threads:[~2020-07-23 22:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18  0:08 [PATCH] usbip: tools: fix build error for multiple definition Antonio Borneo
2020-06-18 17:36 ` Shuah Khan
2020-07-23 22:58   ` Salvatore Bonaccorso

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