Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244948 > unrolled thread

[PATCH] ohci-pci: use PCI_DEVICE_SUB()

Started bySergei Shtylyov <sergei.shtylyov@cogentembedded.com>
First post2015-10-12 19:40 +0200
Last post2015-10-17 14:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ohci-pci: use PCI_DEVICE_SUB() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-12 19:40 +0200
    Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB() Greg KH <gregkh@linuxfoundation.org> - 2015-10-17 08:40 +0200
      Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-17 14:20 +0200

#1244948 — [PATCH] ohci-pci: use PCI_DEVICE_SUB()

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-10-12 19:40 +0200
Subject[PATCH] ohci-pci: use PCI_DEVICE_SUB()
Message-ID<qiPeO-5SP-7@gated-at.bofh.it>
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,
 	},
 	{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1249274

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-10-17 08:40 +0200
Message-ID<qktjP-5Q0-1@gated-at.bofh.it>
In reply to#1244948
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1249320

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-10-17 14:20 +0200
Message-ID<qkyCR-5u3-5@gated-at.bofh.it>
In reply to#1249274
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web