Re: [PATCH] USB: whci-hcd: fix compiler warning

Previous thread: flush_to_ldisc executing 2500 times a second ? by Dave Jones on Tuesday, November 30, 2010 - 9:07 pm. (3 messages)

Next thread: [PATCH] lsm303dlh: Adding Accelerometer and Magnetometer support by Chethan Krishna N on Tuesday, November 30, 2010 - 10:14 pm. (4 messages)
From: Namhyung Kim
Date: Tuesday, November 30, 2010 - 9:28 pm

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

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 drivers/usb/host/whci/hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/whci/hcd.c b/drivers/usb/host/whci/hcd.c
index 72b6892..9546f6c 100644
--- a/drivers/usb/host/whci/hcd.c
+++ b/drivers/usb/host/whci/hcd.c
@@ -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 */ }
 };
-- 
1.7.0.4

--

From: Greg KH
Date: Wednesday, December 1, 2010 - 9:10 am

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

thanks,

greg k-h
--

From: Namhyung Kim
Date: Wednesday, December 1, 2010 - 9:49 am

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

Thanks.

-- 
Regards,
Namhyung Kim


--

From: Namhyung Kim
Date: Wednesday, December 1, 2010 - 10:02 am

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

-- 
Regards,
Namhyung Kim


--

From: David Vrabel
Date: Wednesday, December 1, 2010 - 10:06 am

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

From: Namhyung Kim
Date: Wednesday, December 1, 2010 - 10:11 am

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

-- 
Regards,
Namhyung Kim


--

From: David Vrabel
Date: Wednesday, December 1, 2010 - 9:52 am

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

David
-- 
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
--

From: Greg KH
Date: Wednesday, December 1, 2010 - 10:36 am

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

From: Namhyung Kim
Date: Monday, December 6, 2010 - 6:05 am

Hi, Greg

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

Thanks.


-- 
Regards,
Namhyung Kim


--

From: Greg KH
Date: Monday, December 6, 2010 - 8:56 am

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

greg k-h
--

From: Namhyung Kim
Date: Monday, December 6, 2010 - 9:03 am

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

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 drivers/usb/host/whci/hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/whci/hcd.c b/drivers/usb/host/whci/hcd.c
index 72b6892..9546f6c 100644
--- a/drivers/usb/host/whci/hcd.c
+++ b/drivers/usb/host/whci/hcd.c
@@ -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 */ }
 };
-- 
1.7.0.4

--

Previous thread: flush_to_ldisc executing 2500 times a second ? by Dave Jones on Tuesday, November 30, 2010 - 9:07 pm. (3 messages)

Next thread: [PATCH] lsm303dlh: Adding Accelerometer and Magnetometer support by Chethan Krishna N on Tuesday, November 30, 2010 - 10:14 pm. (4 messages)