lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 17 Oct 2015 15:17:07 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	linux-usb@...r.kernel.org, stern@...land.harvard.edu,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ohci-pci: use PCI_DEVICE_SUB()

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@...entembedded.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ