Skip to contentSkip to conversation

USB: whci-hcd: fix compiler warning

PATCH Superseded Namhyung Kim 4 participants 11 messages Dec 1, 2010 – Dec 6, 2010 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: whci-hcd: fix compiler warning

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

---
 drivers/usb/host/whci/hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/host/whci/hcd.c +1 -1
index 72b6892..9546f6c 100644
@@ -356,7 +356,7 @@ static void __exit whci_hc_driver_exit(void)
 module_exit(whci_hc_driver_exit);
 
 /* PCI device ID's that we handle (so it gets loaded) */
-static struct pci_device_id whci_hcd_id_table[] = {
+static struct pci_device_id __used whci_hcd_id_table[] = {
 	{ PCI_DEVICE_CLASS(PCI_CLASS_WIRELESS_WHCI, ~0) },
 	{ /* empty last entry */ }
 };
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 4 lines · Namhyung Kim

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Are you seeing this warning when you build the module into the kernel, or as a module?

thanks,

greg k-h

#2 lore raw

2010-12-01 (수), 08:10 -0800, Greg KH:

Quoted 6 lines · Namhyung Kim
Quoted 4 lines

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Quoted 6 lines

Are you seeing this warning when you build the module into the kernel, or as a module?

thanks,

greg k-h

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

Thanks.

Signature · 2 lines
Regards,
Namhyung Kim
#3 lore raw
Quoted 9 lines · Namhyung Kim

2010-12-01 (수), 08:10 -0800, Greg KH:

Quoted 8 lines · Namhyung Kim
Quoted 4 lines

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Are you seeing this warning when you build the module into the kernel, or as a module?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

That might be best. Can you do the same with drivers/uwb/whc-rc.c? It will have the same problem.

David

Signature · 6 lines
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
#4 lore raw

2010-12-01 (수), 16:52 +0000, David Vrabel:

Quoted 8 lines
Quoted 2 lines · Namhyung Kim

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

That might be best. Can you do the same with drivers/uwb/whc-rc.c? It will have the same problem.

David

No problem. Will send them soon. :)
Thanks.

Signature · 2 lines
Regards,
Namhyung Kim
#5 lore raw
Quoted 10 lines · Namhyung Kim

2010-12-01 (수), 16:52 +0000, David Vrabel:

Quoted 7 lines
Quoted 2 lines · Namhyung Kim

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

That might be best. Can you do the same with drivers/uwb/whc-rc.c? It will have the same problem.

David

No problem. Will send them soon. :)

Actually CONFIG_MODULES is wrong. It needs to test if the driver has been built as a module or not. I think there's a __MODULE__ or MODULE #define for this, not sure though.

David

Signature · 6 lines
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
#6 lore raw

2010-12-01 (수), 17:06 +0000, David Vrabel:

Quoted 5 lines

Actually CONFIG_MODULES is wrong. It needs to test if the driver has been built as a module or not. I think there's a __MODULE__ or MODULE #define for this, not sure though.

David

Right, we use MODULE. I was just thinking about that :)

Signature · 2 lines
Regards,
Namhyung Kim
#7 lore raw
In reply to Namhyung Kim
Quoted 10 lines · Namhyung Kim

2010-12-01 (수), 08:10 -0800, Greg KH:

Quoted 9 lines · Namhyung Kim
Quoted 4 lines

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Are you seeing this warning when you build the module into the kernel, or as a module?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

No, don't do that, your __used is the correct thing here, I just wanted to make sure why you were seeing this warning.

thanks,

greg k-h

#8 lore raw

2010-12-01 (수), 09:36 -0800, Greg KH:

Quoted 18 lines · Namhyung Kim
Quoted 10 lines

2010-12-01 (수), 08:10 -0800, Greg KH:

Quoted 9 lines · Namhyung Kim
Quoted 4 lines

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Are you seeing this warning when you build the module into the kernel, or as a module?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

Quoted 6 lines

No, don't do that, your __used is the correct thing here, I just wanted to make sure why you were seeing this warning.

thanks,

greg k-h

Hi, Greg

It seems this one is not applied in your tree yet. Do you need a resend?

Thanks.

Signature · 2 lines
Regards,
Namhyung Kim
#9 lore raw
Quoted 22 lines · Namhyung Kim

2010-12-01 (수), 09:36 -0800, Greg KH:

Quoted 21 lines · Namhyung Kim
Quoted 10 lines

2010-12-01 (수), 08:10 -0800, Greg KH:

Quoted 9 lines · Namhyung Kim
Quoted 4 lines

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Are you seeing this warning when you build the module into the kernel, or as a module?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

I saw it during allyesconfig build but not on allmodconfig. Maybe we can wrap it up in #ifdef CONFIG_MODULES ?

No, don't do that, your __used is the correct thing here, I just wanted to make sure why you were seeing this warning.

Quoted 7 lines
Quoted 3 lines

thanks,

greg k-h

Hi, Greg

It seems this one is not applied in your tree yet. Do you need a resend?

Yes please, I must have missed it, thinking it was part of your other series. Sorry.

greg k-h

#10 lore raw

PATCH RESEND 1/1 USB: whci-hcd: fix compiler warning

Annotate whci_hcd_id_table as '__used' to fix following warning:

CC drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

---
 drivers/usb/host/whci/hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/host/whci/hcd.c +1 -1
index 72b6892..9546f6c 100644
@@ -356,7 +356,7 @@ static void __exit whci_hc_driver_exit(void)
 module_exit(whci_hc_driver_exit);
 
 /* PCI device ID's that we handle (so it gets loaded) */
-static struct pci_device_id whci_hcd_id_table[] = {
+static struct pci_device_id __used whci_hcd_id_table[] = {
 	{ PCI_DEVICE_CLASS(PCI_CLASS_WIRELESS_WHCI, ~0) },
 	{ /* empty last entry */ }
 };
Signature · 1 line
1.7.0.4