public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] telephony/ixj: fix compiler warning on ixj_pci_tbl
@ 2010-12-07 15:49 Namhyung Kim
  2010-12-07 21:16 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2010-12-07 15:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Annotate ixj_pci_tbl as '__used' to fix following warning:

  CC      drivers/telephony/ixj.o
drivers/telephony/ixj.c:287: warning: ‘ixj_pci_tbl’ defined but not used

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

diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index 0d236f4..de92133 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -284,7 +284,7 @@ static int samplerate = 100;
 
 module_param(ixjdebug, int, 0);
 
-static struct pci_device_id ixj_pci_tbl[] __devinitdata = {
+static struct pci_device_id ixj_pci_tbl[] __devinitdata __used = {
 	{ PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{ }
-- 
1.7.0.4


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

* Re: [PATCH] telephony/ixj: fix compiler warning on ixj_pci_tbl
  2010-12-07 15:49 [PATCH] telephony/ixj: fix compiler warning on ixj_pci_tbl Namhyung Kim
@ 2010-12-07 21:16 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2010-12-07 21:16 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: linux-kernel

On Wed,  8 Dec 2010 00:49:53 +0900
Namhyung Kim <namhyung@gmail.com> wrote:

> Annotate ixj_pci_tbl as '__used' to fix following warning:
> 
>   CC      drivers/telephony/ixj.o
> drivers/telephony/ixj.c:287: warning: ___ixj_pci_tbl___ defined but not used
> 
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
>  drivers/telephony/ixj.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
> index 0d236f4..de92133 100644
> --- a/drivers/telephony/ixj.c
> +++ b/drivers/telephony/ixj.c
> @@ -284,7 +284,7 @@ static int samplerate = 100;
>  
>  module_param(ixjdebug, int, 0);
>  
> -static struct pci_device_id ixj_pci_tbl[] __devinitdata = {
> +static struct pci_device_id ixj_pci_tbl[] __devinitdata __used = {
>  	{ PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ,
>  	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
>  	{ }

This way, I believe:

--- a/drivers/telephony/ixj.c~a
+++ a/drivers/telephony/ixj.c
@@ -284,12 +284,11 @@ static int samplerate = 100;
 
 module_param(ixjdebug, int, 0);
 
-static struct pci_device_id ixj_pci_tbl[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(ixj_pci_tbl) = {
 	{ PCI_VENDOR_ID_QUICKNET, PCI_DEVICE_ID_QUICKNET_XJ,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{ }
 };
-
 MODULE_DEVICE_TABLE(pci, ixj_pci_tbl);
 
 /************************************************************************

It fixes the warning, but I'm not sure how it did that.

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

end of thread, other threads:[~2010-12-07 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07 15:49 [PATCH] telephony/ixj: fix compiler warning on ixj_pci_tbl Namhyung Kim
2010-12-07 21:16 ` Andrew Morton

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