linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ohci-pci: use PCI_DEVICE_SUB()
@ 2015-10-12 17:31 Sergei Shtylyov
  2015-10-17  6:39 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2015-10-12 17:31 UTC (permalink / raw)
  To: gregkh, linux-usb, stern; +Cc: linux-kernel

Toshiba  Portege 4000 quirk entry can be written shorter using the
PCI_DEVICE_SUB() macro.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.

 drivers/usb/host/ohci-pci.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: usb/drivers/usb/host/ohci-pci.c
===================================================================
--- usb.orig/drivers/usb/host/ohci-pci.c
+++ usb/drivers/usb/host/ohci-pci.c
@@ -192,10 +192,8 @@ static const struct pci_device_id ohci_p
 	},
 	{
 		/* Toshiba portege 4000 */
-		.vendor		= PCI_VENDOR_ID_AL,
-		.device		= 0x5237,
-		.subvendor	= PCI_VENDOR_ID_TOSHIBA,
-		.subdevice	= 0x0004,
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_AL, 0x5237,
+			       PCI_VENDOR_ID_TOSHIBA, 0x0004),
 		.driver_data	= (unsigned long) broken_suspend,
 	},
 	{

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

* Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB()
  2015-10-12 17:31 [PATCH] ohci-pci: use PCI_DEVICE_SUB() Sergei Shtylyov
@ 2015-10-17  6:39 ` Greg KH
  2015-10-17 12:17   ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2015-10-17  6:39 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-usb, stern, linux-kernel

On Mon, Oct 12, 2015 at 08:31:55PM +0300, Sergei Shtylyov wrote:
> Toshiba  Portege 4000 quirk entry can be written shorter using the
> PCI_DEVICE_SUB() macro.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> The patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
> 
>  drivers/usb/host/ohci-pci.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> Index: usb/drivers/usb/host/ohci-pci.c
> ===================================================================
> --- usb.orig/drivers/usb/host/ohci-pci.c
> +++ usb/drivers/usb/host/ohci-pci.c
> @@ -192,10 +192,8 @@ static const struct pci_device_id ohci_p
>  	},
>  	{
>  		/* Toshiba portege 4000 */
> -		.vendor		= PCI_VENDOR_ID_AL,
> -		.device		= 0x5237,
> -		.subvendor	= PCI_VENDOR_ID_TOSHIBA,
> -		.subdevice	= 0x0004,
> +		PCI_DEVICE_SUB(PCI_VENDOR_ID_AL, 0x5237,
> +			       PCI_VENDOR_ID_TOSHIBA, 0x0004),

But it's much less readable now, right?  Why make this change then?

sorry,

greg k-h

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

* Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB()
  2015-10-17  6:39 ` Greg KH
@ 2015-10-17 12:17   ` Sergei Shtylyov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2015-10-17 12:17 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, stern, linux-kernel

On 10/17/2015 9:39 AM, Greg KH wrote:

>> Toshiba  Portege 4000 quirk entry can be written shorter using the
>> PCI_DEVICE_SUB() macro.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> The patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
>>
>>   drivers/usb/host/ohci-pci.c |    6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> Index: usb/drivers/usb/host/ohci-pci.c
>> ===================================================================
>> --- usb.orig/drivers/usb/host/ohci-pci.c
>> +++ usb/drivers/usb/host/ohci-pci.c
>> @@ -192,10 +192,8 @@ static const struct pci_device_id ohci_p
>>   	},
>>   	{
>>   		/* Toshiba portege 4000 */
>> -		.vendor		= PCI_VENDOR_ID_AL,
>> -		.device		= 0x5237,
>> -		.subvendor	= PCI_VENDOR_ID_TOSHIBA,
>> -		.subdevice	= 0x0004,
>> +		PCI_DEVICE_SUB(PCI_VENDOR_ID_AL, 0x5237,
>> +			       PCI_VENDOR_ID_TOSHIBA, 0x0004),
>
> But it's much less readable now, right?

    To me, the field names like sub{vendor|device} also don't seem very 
readable, I'd prefer subsys_{vendor|device}. Does your logic extend to using 
the mere USB_DEVICE() macro too?

> Why make this change then?

    For brevity's sake. The same reason they called the fields sub{vendor|device}.

> sorry,
>
> greg k-h

MBR, Sergei


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

end of thread, other threads:[~2015-10-17 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-12 17:31 [PATCH] ohci-pci: use PCI_DEVICE_SUB() Sergei Shtylyov
2015-10-17  6:39 ` Greg KH
2015-10-17 12:17   ` Sergei Shtylyov

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