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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPybu_2KztdWmExKXO8uEebpQPouN7wqQww5ZzknmC5-hXvDJA@mail.gmail.com>
Date:	Tue, 20 May 2014 16:38:01 +0200
From:	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	"balbi@...com" <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux USB Mailing List <linux-usb@...r.kernel.org>,
	Joe Perches <joe@...ches.com>,
	Amit Uttamchandani <auttamchandani@...icube.com>
Subject: Re: [PATCH 2/9] usb: gadget: net2280: Dont use magic numbers

Hello Alan

In this case, there are only two family of devices supported by the
driver. Maybe quirks are too much.

At the end:

ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY

is not much bigger than

ep->dev->quirk_flag & PLX_NET2280_QUIRK

But if you prefer the quirk I dont mind implementing it, but please as
a follow-up patch, since there are 8 patches depending on this :)

Regards!


On Tue, May 20, 2014 at 4:21 PM, Alan Stern <stern@...land.harvard.edu> wrote:
> On Mon, 19 May 2014, Ricardo Ribalda Delgado wrote:
>
>> Instead of using magic numbers use #defines
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
>> ---
>>  drivers/usb/gadget/net2280.c | 68 +++++++++++++++++++++++---------------------
>>  drivers/usb/gadget/net2280.h |  1 +
>>  2 files changed, 36 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
>> index 8112d91..ba1fdd8 100644
>> --- a/drivers/usb/gadget/net2280.c
>> +++ b/drivers/usb/gadget/net2280.c
>> @@ -152,7 +152,7 @@ static inline void enable_pciirqenb(struct net2280_ep *ep)
>>  {
>>       u32 tmp = readl(&ep->dev->regs->pciirqenb0);
>>
>> -     if (ep->dev->pdev->vendor == 0x17cc)
>> +     if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
>
> You ought to be able to make this considerably smaller by using a
> quirk flag in ep->dev.  The flag can indicate whether or not the
> controller uses the LEGACY interface.
>
> Alan Stern
>



-- 
Ricardo Ribalda
--
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