linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
@ 2011-12-02  3:02 Axel Lin
  2011-12-02 15:42 ` Brent Casavant
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Axel Lin @ 2011-12-02  3:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jiri Slaby, Alex Dubov, David Altobelli, Brent Casavant,
	J Freyensee, Arnd Bergmann, Greg Kroah-Hartman

Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
readablity.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: David Altobelli <david.altobelli@hp.com>
Cc: Brent Casavant <bcasavan@sgi.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: J Freyensee <james_p_freyensee@linux.intel.com>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/misc/hpilo.c     |    2 +-
 drivers/misc/ioc4.c      |    6 +++---
 drivers/misc/pch_phub.c  |    2 +-
 drivers/misc/phantom.c   |    2 +-
 drivers/misc/pti.c       |    2 +-
 drivers/misc/tifm_7xx1.c |   11 ++++-------
 6 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
index fffc227..f705cbb 100644
--- a/drivers/misc/hpilo.c
+++ b/drivers/misc/hpilo.c
@@ -828,7 +828,7 @@ out:
 	return error;
 }
 
-static struct pci_device_id ilo_devices[] = {
+static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
 	{ }
diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
index df03dd3..46adc36 100644
--- a/drivers/misc/ioc4.c
+++ b/drivers/misc/ioc4.c
@@ -456,9 +456,9 @@ ioc4_remove(struct pci_dev *pdev)
 	kfree(idd);
 }
 
-static struct pci_device_id ioc4_id_table[] = {
-	{PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
-	 PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
+static DEFINE_PCI_DEVICE_TABLE(ioc4_id_table) = {
+	{ PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4),
+	  .class = 0x0b4000, .class_mask = 0xFFFFFF },
 	{0}
 };
 
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 10fc478..daa19c2 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -878,7 +878,7 @@ static int pch_phub_resume(struct pci_dev *pdev)
 #define pch_phub_resume NULL
 #endif /* CONFIG_PM */
 
-static struct pci_device_id pch_phub_pcidev_id[] = {
+static DEFINE_PCI_DEVICE_TABLE(pch_phub_pcidev_id) = {
 	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH1_PHUB),       1,  },
 	{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7213_PHUB), 2,  },
 	{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_mPHUB), 3,  },
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 21b28fc..7f12ee6 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -487,7 +487,7 @@ static int phantom_resume(struct pci_dev *pdev)
 #define phantom_resume	NULL
 #endif
 
-static struct pci_device_id phantom_pci_tbl[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(phantom_pci_tbl) = {
 	{ .vendor = PCI_VENDOR_ID_PLX, .device = PCI_DEVICE_ID_PLX_9050,
 	  .subvendor = PCI_VENDOR_ID_PLX, .subdevice = PCI_DEVICE_ID_PLX_9050,
 	  .class = PCI_CLASS_BRIDGE_OTHER << 8, .class_mask = 0xffff00 },
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 0b56e3f..03843e3 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -76,7 +76,7 @@ struct pti_dev {
  */
 static DEFINE_MUTEX(alloclock);
 
-static struct pci_device_id pci_ids[] __devinitconst = {
+static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
 		{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x82B)},
 		{0}
 };
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index ba24790..a93adcca 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -415,13 +415,10 @@ static void tifm_7xx1_remove(struct pci_dev *dev)
 	tifm_free_adapter(fm);
 }
 
-static struct pci_device_id tifm_7xx1_pci_tbl [] = {
-	{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11_FM, PCI_ANY_ID,
-	  PCI_ANY_ID, 0, 0, 0 }, /* xx21 - the one I have */
-        { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12_FM, PCI_ANY_ID,
-	  PCI_ANY_ID, 0, 0, 0 },
-	{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX20_FM, PCI_ANY_ID,
-	  PCI_ANY_ID, 0, 0, 0 },
+static DEFINE_PCI_DEVICE_TABLE(tifm_7xx1_pci_tbl) = {
+	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX21_XX11_FM) },
+	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX12_FM) },
+	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX20_FM) },
 	{ }
 };
 
-- 
1.7.5.4




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

* Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-02  3:02 [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE Axel Lin
@ 2011-12-02 15:42 ` Brent Casavant
  2011-12-02 15:50 ` Altobelli, David
  2011-12-02 16:03 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Brent Casavant @ 2011-12-02 15:42 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jiri Slaby, Alex Dubov, David Altobelli,
	J Freyensee, Arnd Bergmann, Greg Kroah-Hartman

Acked-by: Brent Casavant <bcasavan@sgi.com>

On Fri, 2 Dec 2011, Axel Lin wrote:

> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> readablity.
> 
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <greg@kroah.com>
> Cc: David Altobelli <david.altobelli@hp.com>
> Cc: Brent Casavant <bcasavan@sgi.com>
> Cc: Jiri Slaby <jirislaby@gmail.com>
> Cc: J Freyensee <james_p_freyensee@linux.intel.com>
> Cc: Alex Dubov <oakad@yahoo.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/misc/hpilo.c     |    2 +-
>  drivers/misc/ioc4.c      |    6 +++---
>  drivers/misc/pch_phub.c  |    2 +-
>  drivers/misc/phantom.c   |    2 +-
>  drivers/misc/pti.c       |    2 +-
>  drivers/misc/tifm_7xx1.c |   11 ++++-------
>  6 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
> index fffc227..f705cbb 100644
> --- a/drivers/misc/hpilo.c
> +++ b/drivers/misc/hpilo.c
> @@ -828,7 +828,7 @@ out:
>  	return error;
>  }
>  
> -static struct pci_device_id ilo_devices[] = {
> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
>  	{ }
> diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
> index df03dd3..46adc36 100644
> --- a/drivers/misc/ioc4.c
> +++ b/drivers/misc/ioc4.c
> @@ -456,9 +456,9 @@ ioc4_remove(struct pci_dev *pdev)
>  	kfree(idd);
>  }
>  
> -static struct pci_device_id ioc4_id_table[] = {
> -	{PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
> -	 PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
> +static DEFINE_PCI_DEVICE_TABLE(ioc4_id_table) = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4),
> +	  .class = 0x0b4000, .class_mask = 0xFFFFFF },
>  	{0}
>  };
>  
> diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
> index 10fc478..daa19c2 100644
> --- a/drivers/misc/pch_phub.c
> +++ b/drivers/misc/pch_phub.c
> @@ -878,7 +878,7 @@ static int pch_phub_resume(struct pci_dev *pdev)
>  #define pch_phub_resume NULL
>  #endif /* CONFIG_PM */
>  
> -static struct pci_device_id pch_phub_pcidev_id[] = {
> +static DEFINE_PCI_DEVICE_TABLE(pch_phub_pcidev_id) = {
>  	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH1_PHUB),       1,  },
>  	{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7213_PHUB), 2,  },
>  	{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_mPHUB), 3,  },
> diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
> index 21b28fc..7f12ee6 100644
> --- a/drivers/misc/phantom.c
> +++ b/drivers/misc/phantom.c
> @@ -487,7 +487,7 @@ static int phantom_resume(struct pci_dev *pdev)
>  #define phantom_resume	NULL
>  #endif
>  
> -static struct pci_device_id phantom_pci_tbl[] __devinitdata = {
> +static DEFINE_PCI_DEVICE_TABLE(phantom_pci_tbl) = {
>  	{ .vendor = PCI_VENDOR_ID_PLX, .device = PCI_DEVICE_ID_PLX_9050,
>  	  .subvendor = PCI_VENDOR_ID_PLX, .subdevice = PCI_DEVICE_ID_PLX_9050,
>  	  .class = PCI_CLASS_BRIDGE_OTHER << 8, .class_mask = 0xffff00 },
> diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
> index 0b56e3f..03843e3 100644
> --- a/drivers/misc/pti.c
> +++ b/drivers/misc/pti.c
> @@ -76,7 +76,7 @@ struct pti_dev {
>   */
>  static DEFINE_MUTEX(alloclock);
>  
> -static struct pci_device_id pci_ids[] __devinitconst = {
> +static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
>  		{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x82B)},
>  		{0}
>  };
> diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
> index ba24790..a93adcca 100644
> --- a/drivers/misc/tifm_7xx1.c
> +++ b/drivers/misc/tifm_7xx1.c
> @@ -415,13 +415,10 @@ static void tifm_7xx1_remove(struct pci_dev *dev)
>  	tifm_free_adapter(fm);
>  }
>  
> -static struct pci_device_id tifm_7xx1_pci_tbl [] = {
> -	{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11_FM, PCI_ANY_ID,
> -	  PCI_ANY_ID, 0, 0, 0 }, /* xx21 - the one I have */
> -        { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12_FM, PCI_ANY_ID,
> -	  PCI_ANY_ID, 0, 0, 0 },
> -	{ PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX20_FM, PCI_ANY_ID,
> -	  PCI_ANY_ID, 0, 0, 0 },
> +static DEFINE_PCI_DEVICE_TABLE(tifm_7xx1_pci_tbl) = {
> +	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX21_XX11_FM) },
> +	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX12_FM) },
> +	{ PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_XX20_FM) },
>  	{ }
>  };
>  
> -- 
> 1.7.5.4
> 
> 
> 

-- 
Brent Casavant                      Silicon Graphics International, Inc.
System software BIOS engineering    http://www.sgi.com/products/server/uv

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

* RE: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-02  3:02 [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE Axel Lin
  2011-12-02 15:42 ` Brent Casavant
@ 2011-12-02 15:50 ` Altobelli, David
  2011-12-02 16:03 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Altobelli, David @ 2011-12-02 15:50 UTC (permalink / raw)
  To: Axel Lin, linux-kernel
  Cc: Jiri Slaby, Alex Dubov, Brent Casavant, J Freyensee,
	Arnd Bergmann, Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 929 bytes --]

-----Original Message-----
> From: Axel Lin 
> Subject: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE

> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> readablity.

> drivers/misc/hpilo.c     |    2 +-
 
> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
> index fffc227..f705cbb 100644
> --- a/drivers/misc/hpilo.c
> +++ b/drivers/misc/hpilo.c
> @@ -828,7 +828,7 @@ out:
>  	return error;
> }
 
> -static struct pci_device_id ilo_devices[] = {
> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
> 	{ PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
> 	{ }

Acked-by: David Altobelli <david.altobelli@hp.com>

Thanks
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-02  3:02 [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE Axel Lin
  2011-12-02 15:42 ` Brent Casavant
  2011-12-02 15:50 ` Altobelli, David
@ 2011-12-02 16:03 ` Greg KH
  2011-12-02 21:01   ` Joe Perches
  2011-12-03  1:04   ` Axel Lin
  2 siblings, 2 replies; 7+ messages in thread
From: Greg KH @ 2011-12-02 16:03 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jiri Slaby, Alex Dubov, David Altobelli,
	Brent Casavant, J Freyensee, Arnd Bergmann

On Fri, Dec 02, 2011 at 11:02:57AM +0800, Axel Lin wrote:
> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> readablity.
> 
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <greg@kroah.com>
> Cc: David Altobelli <david.altobelli@hp.com>
> Cc: Brent Casavant <bcasavan@sgi.com>
> Cc: Jiri Slaby <jirislaby@gmail.com>
> Cc: J Freyensee <james_p_freyensee@linux.intel.com>
> Cc: Alex Dubov <oakad@yahoo.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/misc/hpilo.c     |    2 +-
>  drivers/misc/ioc4.c      |    6 +++---
>  drivers/misc/pch_phub.c  |    2 +-
>  drivers/misc/phantom.c   |    2 +-
>  drivers/misc/pti.c       |    2 +-
>  drivers/misc/tifm_7xx1.c |   11 ++++-------
>  6 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
> index fffc227..f705cbb 100644
> --- a/drivers/misc/hpilo.c
> +++ b/drivers/misc/hpilo.c
> @@ -828,7 +828,7 @@ out:
>  	return error;
>  }
>  
> -static struct pci_device_id ilo_devices[] = {
> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {

No, I hate this macro, see, it's actually taking you more characters to
use it than to just properly define the structure yourself.  It's
pointless and stupid.

So no, I'm not going to accept this patch, sorry.

I would love to see a patch removing this macro from the kernel, but I'm
not the PCI maintainer anymore, so I can't directly accept it :(

>  	{ PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
>  	{ }
> diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
> index df03dd3..46adc36 100644
> --- a/drivers/misc/ioc4.c
> +++ b/drivers/misc/ioc4.c
> @@ -456,9 +456,9 @@ ioc4_remove(struct pci_dev *pdev)
>  	kfree(idd);
>  }
>  
> -static struct pci_device_id ioc4_id_table[] = {
> -	{PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
> -	 PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
> +static DEFINE_PCI_DEVICE_TABLE(ioc4_id_table) = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4),
> +	  .class = 0x0b4000, .class_mask = 0xFFFFFF },

But the PCI_DEVICE() changes, yes, those are good as they make things
much more obvious as to what is going on.  Care to send me a patch for
just that instead?

thanks,

greg k-h

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

* Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-02 16:03 ` Greg KH
@ 2011-12-02 21:01   ` Joe Perches
  2011-12-03  1:04   ` Axel Lin
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2011-12-02 21:01 UTC (permalink / raw)
  To: Greg KH
  Cc: Axel Lin, linux-kernel, Jiri Slaby, Alex Dubov, David Altobelli,
	Brent Casavant, J Freyensee, Arnd Bergmann

On Fri, 2011-12-02 at 08:03 -0800, Greg KH wrote:
> On Fri, Dec 02, 2011 at 11:02:57AM +0800, Axel Lin wrote:
> > Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> > tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> > readablity.
[]
> > diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
[]
> > @@ -828,7 +828,7 @@ out:
> >  	return error;
> >  }
> >  
> > -static struct pci_device_id ilo_devices[] = {
> > +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
> 
> No, I hate this macro, see, it's actually taking you more characters to
> use it than to just properly define the structure yourself.  It's
> pointless and stupid.

Not quite.

include/linux/pci.h:#define DEFINE_PCI_DEVICE_TABLE(_table) \
include/linux/pci.h-	const struct pci_device_id _table[] __devinitconst

Using the macro does declare the struct const and
use attribute __devinitconst to place the table into
section .devinit.rodata.

The straight definition does not.

> So no, I'm not going to accept this patch, sorry.

Never in doubt, not always right...

cheers, Joe


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

* Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-02 16:03 ` Greg KH
  2011-12-02 21:01   ` Joe Perches
@ 2011-12-03  1:04   ` Axel Lin
  2011-12-03  1:11     ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Axel Lin @ 2011-12-03  1:04 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-kernel, Jiri Slaby, Alex Dubov, David Altobelli,
	Brent Casavant, J Freyensee, Arnd Bergmann

2011/12/3 Greg KH <greg@kroah.com>:
> On Fri, Dec 02, 2011 at 11:02:57AM +0800, Axel Lin wrote:
>> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
>> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
>> readablity.
>>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Greg Kroah-Hartman <greg@kroah.com>
>> Cc: David Altobelli <david.altobelli@hp.com>
>> Cc: Brent Casavant <bcasavan@sgi.com>
>> Cc: Jiri Slaby <jirislaby@gmail.com>
>> Cc: J Freyensee <james_p_freyensee@linux.intel.com>
>> Cc: Alex Dubov <oakad@yahoo.com>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>> ---
>>  drivers/misc/hpilo.c     |    2 +-
>>  drivers/misc/ioc4.c      |    6 +++---
>>  drivers/misc/pch_phub.c  |    2 +-
>>  drivers/misc/phantom.c   |    2 +-
>>  drivers/misc/pti.c       |    2 +-
>>  drivers/misc/tifm_7xx1.c |   11 ++++-------
>>  6 files changed, 11 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
>> index fffc227..f705cbb 100644
>> --- a/drivers/misc/hpilo.c
>> +++ b/drivers/misc/hpilo.c
>> @@ -828,7 +828,7 @@ out:
>>       return error;
>>  }
>>
>> -static struct pci_device_id ilo_devices[] = {
>> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
>
> No, I hate this macro, see, it's actually taking you more characters to
> use it than to just properly define the structure yourself.  It's
> pointless and stupid.
>
$ grep -r "^static .*pci_device_id" drivers/misc/*
drivers/misc/cb710/core.c:static const struct pci_device_id cb710_pci_tbl[] = {
drivers/misc/hpilo.c:static struct pci_device_id ilo_devices[] = {
drivers/misc/ibmasm/module.c:static int __devinit
ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
drivers/misc/ibmasm/module.c:static struct pci_device_id ibmasm_pci_table[] =
drivers/misc/ioc4.c:static struct pci_device_id ioc4_id_table[] = {
drivers/misc/pch_phub.c:static struct pci_device_id pch_phub_pcidev_id[] = {
drivers/misc/phantom.c:static struct pci_device_id phantom_pci_tbl[]
__devinitdata = {
drivers/misc/pti.c:static struct pci_device_id pci_ids[] __devinitconst = {
drivers/misc/tifm_7xx1.c:static struct pci_device_id tifm_7xx1_pci_tbl [] = {

Some drivers missed const and __devinitconst annotations, it would be
easier to use
DEFINE_PCI_DEVICE_TABLE.

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

* Re: [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE
  2011-12-03  1:04   ` Axel Lin
@ 2011-12-03  1:11     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2011-12-03  1:11 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jiri Slaby, Alex Dubov, David Altobelli,
	Brent Casavant, J Freyensee, Arnd Bergmann

On Sat, Dec 03, 2011 at 09:04:45AM +0800, Axel Lin wrote:
> 2011/12/3 Greg KH <greg@kroah.com>:
> > On Fri, Dec 02, 2011 at 11:02:57AM +0800, Axel Lin wrote:
> >> Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
> >> tables. Also convert to the PCI_DEVICE/PCI_VDEVICE macros for better
> >> readablity.
> >>
> >> Cc: Arnd Bergmann <arnd@arndb.de>
> >> Cc: Greg Kroah-Hartman <greg@kroah.com>
> >> Cc: David Altobelli <david.altobelli@hp.com>
> >> Cc: Brent Casavant <bcasavan@sgi.com>
> >> Cc: Jiri Slaby <jirislaby@gmail.com>
> >> Cc: J Freyensee <james_p_freyensee@linux.intel.com>
> >> Cc: Alex Dubov <oakad@yahoo.com>
> >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >> ---
> >>  drivers/misc/hpilo.c     |    2 +-
> >>  drivers/misc/ioc4.c      |    6 +++---
> >>  drivers/misc/pch_phub.c  |    2 +-
> >>  drivers/misc/phantom.c   |    2 +-
> >>  drivers/misc/pti.c       |    2 +-
> >>  drivers/misc/tifm_7xx1.c |   11 ++++-------
> >>  6 files changed, 11 insertions(+), 14 deletions(-)
> >>
> >> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
> >> index fffc227..f705cbb 100644
> >> --- a/drivers/misc/hpilo.c
> >> +++ b/drivers/misc/hpilo.c
> >> @@ -828,7 +828,7 @@ out:
> >>       return error;
> >>  }
> >>
> >> -static struct pci_device_id ilo_devices[] = {
> >> +static DEFINE_PCI_DEVICE_TABLE(ilo_devices) = {
> >
> > No, I hate this macro, see, it's actually taking you more characters to
> > use it than to just properly define the structure yourself.  It's
> > pointless and stupid.
> >
> $ grep -r "^static .*pci_device_id" drivers/misc/*
> drivers/misc/cb710/core.c:static const struct pci_device_id cb710_pci_tbl[] = {
> drivers/misc/hpilo.c:static struct pci_device_id ilo_devices[] = {
> drivers/misc/ibmasm/module.c:static int __devinit
> ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
> drivers/misc/ibmasm/module.c:static struct pci_device_id ibmasm_pci_table[] =
> drivers/misc/ioc4.c:static struct pci_device_id ioc4_id_table[] = {
> drivers/misc/pch_phub.c:static struct pci_device_id pch_phub_pcidev_id[] = {
> drivers/misc/phantom.c:static struct pci_device_id phantom_pci_tbl[]
> __devinitdata = {
> drivers/misc/pti.c:static struct pci_device_id pci_ids[] __devinitconst = {
> drivers/misc/tifm_7xx1.c:static struct pci_device_id tifm_7xx1_pci_tbl [] = {
> 
> Some drivers missed const and __devinitconst annotations, it would be
> easier to use
> DEFINE_PCI_DEVICE_TABLE.

I still don't like it, sorry.

greg "stick in the mud" k-h

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

end of thread, other threads:[~2011-12-03  1:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02  3:02 [PATCH] MISC: Convert to DEFINE_PCI_DEVICE_TABLE Axel Lin
2011-12-02 15:42 ` Brent Casavant
2011-12-02 15:50 ` Altobelli, David
2011-12-02 16:03 ` Greg KH
2011-12-02 21:01   ` Joe Perches
2011-12-03  1:04   ` Axel Lin
2011-12-03  1:11     ` Greg KH

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