public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
@ 2011-11-06 21:05 Peter Huewe
  2011-11-06 21:37 ` Aaro Koskinen
  2011-11-06 22:12 ` [PATCH v2] " Peter Huewe
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Huewe @ 2011-11-06 21:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnaud Patard, Aaro Koskinen, Dan Carpenter, devel, linux-kernel,
	Peter Huewe

This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readability.

KernelVersion: Staging-20111106
---
 drivers/staging/xgifb/XGI_main.h |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 71aebe3..0c3f421 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -32,14 +32,10 @@
 #endif
 
 static DEFINE_PCI_DEVICE_TABLE(xgifb_pci_table) = {
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 0},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 1},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 2},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 3},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), 0, 0, 0},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27), 0, 0, 1},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40), 0, 0, 2},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42), 0, 0, 3},
 	{0}
 };
 
-- 
1.7.3.4


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

* Re: [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
  2011-11-06 21:05 [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) Peter Huewe
@ 2011-11-06 21:37 ` Aaro Koskinen
  2011-11-06 22:02   ` Peter Hüwe
  2011-11-06 22:12 ` [PATCH v2] " Peter Huewe
  1 sibling, 1 reply; 6+ messages in thread
From: Aaro Koskinen @ 2011-11-06 21:37 UTC (permalink / raw)
  To: Peter Huewe
  Cc: Greg Kroah-Hartman, Arnaud Patard, Dan Carpenter, devel,
	linux-kernel

Hi,

On 6.11.2011, at 23.05, Peter Huewe wrote:
> This patch converts pci_table entries to use the PCI_DEVICE macro,
> if .subvendor and .subdevice are set to PCI_ANY_ID,
> and thus improves readability.
>
> KernelVersion: Staging-20111106
> ---
>  drivers/staging/xgifb/XGI_main.h |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/ 
> xgifb/XGI_main.h
> index 71aebe3..0c3f421 100644
> --- a/drivers/staging/xgifb/XGI_main.h
> +++ b/drivers/staging/xgifb/XGI_main.h
> @@ -32,14 +32,10 @@
>  #endif
>
>  static DEFINE_PCI_DEVICE_TABLE(xgifb_pci_table) = {
> -	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID,
> -	 0, 0, 0},
> -	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27, PCI_ANY_ID, PCI_ANY_ID,
> -	 0, 0, 1},
> -	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40, PCI_ANY_ID, PCI_ANY_ID,
> -	 0, 0, 2},
> -	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42, PCI_ANY_ID, PCI_ANY_ID,
> -	 0, 0, 3},
> +	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), 0, 0, 0},

I think the correct way would be

	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), .driver_data = 0},

or

	{PCI_VDEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), 0},

But I don't see the driver_data even being used anywhere, so then you  
could
just simply say:

	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20)},

A.


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

* Re: [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
  2011-11-06 21:37 ` Aaro Koskinen
@ 2011-11-06 22:02   ` Peter Hüwe
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Hüwe @ 2011-11-06 22:02 UTC (permalink / raw)
  To: Aaro Koskinen, Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-kernel

Am Sonntag 06 November 2011, 22:37:53 schrieb Aaro Koskinen:
> > -	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID,
> > -	 0, 0, 0},
> > +	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), 0, 0, 0},
> I think the correct way would be
> 
> 	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), .driver_data = 0},

I was thinking about this, but I guess it's not that better than 0,0,0)

> or
> 
> 	{PCI_VDEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20), 0},

Greg hates this macro, that's why I did not use this ;)
He once wrote:
GKH> The main reason I hate this [PCI_VDEVICE] macro, is that it now makes it 
GKH> almost  impossible to grep for any users of the PCI_VENDOR_DIGI pci
GKH> vendor id. I much prefer the PCI_DEVICE() macro instead, and as such, I'm 
GKH> not willing to take any of these patches, sorry.

> But I don't see the driver_data even being used anywhere, so then you
> could
> just simply say:
> 
> 	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20)},

Good catch, it seems so, so  I'll create a v2

Peter


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

* [PATCH v2] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
  2011-11-06 21:05 [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) Peter Huewe
  2011-11-06 21:37 ` Aaro Koskinen
@ 2011-11-06 22:12 ` Peter Huewe
  2011-11-06 22:39   ` Dan Carpenter
  2011-11-06 22:45   ` [PATCH v3] " Peter Huewe
  1 sibling, 2 replies; 6+ messages in thread
From: Peter Huewe @ 2011-11-06 22:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Aaro Koskinen, Dan Carpenter, devel, linux-kernel, Peter Huewe

This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readability.

v2:
Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.
(found by Aaro Koskinen)

KernelVersion: Staging-20111106

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/xgifb/XGI_main.h |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 71aebe3..cf4c188 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -32,14 +32,10 @@
 #endif
 
 static DEFINE_PCI_DEVICE_TABLE(xgifb_pci_table) = {
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 0},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 1},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 2},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 3},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42)},
 	{0}
 };
 
-- 
1.7.3.4


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

* Re: [PATCH v2] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
  2011-11-06 22:12 ` [PATCH v2] " Peter Huewe
@ 2011-11-06 22:39   ` Dan Carpenter
  2011-11-06 22:45   ` [PATCH v3] " Peter Huewe
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2011-11-06 22:39 UTC (permalink / raw)
  To: Peter Huewe; +Cc: Greg Kroah-Hartman, devel, linux-kernel, Aaro Koskinen

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

On Sun, Nov 06, 2011 at 11:12:28PM +0100, Peter Huewe wrote:
> This patch converts pci_table entries to use the PCI_DEVICE macro,
> if .subvendor and .subdevice are set to PCI_ANY_ID,
> and thus improves readability.
> 
> v2:
> Since the driver_data field isn't used anywhere we can also drop the
> assignments for class, class_mask and driver_data.
> (found by Aaro Koskinen)
> 
> KernelVersion: Staging-20111106

Don't put that into the permanent changelog.

Sometimes we ask people what tree they wrote a patch against, but the
truth is that we don't actually care.

Q: Your patch doesn't apply.  Which tree did you do it against?
A: Blah blah blah long explanation.
Q: Oh that's very nice and lovely.  Please redo it against today's
   -next tree.

For bug fixes where it could go into either the current kernel or the
next, then it is nice to say.  Normally people want a [patch -next
v2] in the subject which will get removed by git am.  Or below the
--- dashes.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v3] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
  2011-11-06 22:12 ` [PATCH v2] " Peter Huewe
  2011-11-06 22:39   ` Dan Carpenter
@ 2011-11-06 22:45   ` Peter Huewe
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Huewe @ 2011-11-06 22:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Aaro Koskinen, Dan Carpenter, devel, linux-kernel, Peter Huewe

This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readability.

v2:
Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.
(found by Aaro Koskinen)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
v3:
Moved
KernelVersion: Staging-20111106
below the dashes.

 drivers/staging/xgifb/XGI_main.h |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 71aebe3..cf4c188 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -32,14 +32,10 @@
 #endif
 
 static DEFINE_PCI_DEVICE_TABLE(xgifb_pci_table) = {
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 0},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 1},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 2},
-	{PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42, PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0, 3},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_20)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_27)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_40)},
+	{PCI_DEVICE(PCI_VENDOR_ID_XG, PCI_DEVICE_ID_XG_42)},
 	{0}
 };
 
-- 
1.7.3.4


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

end of thread, other threads:[~2011-11-06 22:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06 21:05 [PATCH] staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) Peter Huewe
2011-11-06 21:37 ` Aaro Koskinen
2011-11-06 22:02   ` Peter Hüwe
2011-11-06 22:12 ` [PATCH v2] " Peter Huewe
2011-11-06 22:39   ` Dan Carpenter
2011-11-06 22:45   ` [PATCH v3] " Peter Huewe

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