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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170404061237.Horde.DFyuMUPIoie1ZXD61kdv01c@gator4166.hostgator.com>
Date:   Tue, 04 Apr 2017 06:12:37 -0500
From:   "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To:     Felipe Balbi <felipe.balbi@...ux.intel.com>
Cc:     Alan Stern <stern@...land.harvard.edu>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Peter Chen <peter.chen@....com>,
        Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Mathias Nyman <mathias.nyman@...ux.intel.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Peter Senna Tschudin <peter.senna@...il.com>
Subject: Re: [PATCH 2/2] usb: misc: refactor code

Hello,

Quoting Felipe Balbi <felipe.balbi@...ux.intel.com>:

> Hi,
>
> "Gustavo A. R. Silva" <garsilva@...eddedor.com> writes:
>> Code refactoring to make the flow easier to follow.
>>
>> Cc: Alan Stern <stern@...loand.harvard.edu>
>> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
>> ---
>>  drivers/usb/misc/usbtest.c | 67  
>> +++++++++++++++++++++-------------------------
>>  1 file changed, 30 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
>> index 7bfb6b78..382491e 100644
>> --- a/drivers/usb/misc/usbtest.c
>> +++ b/drivers/usb/misc/usbtest.c
>> @@ -124,18 +124,32 @@ static struct usb_device  
>> *testdev_to_usbdev(struct usbtest_dev *test)
>>
>>   
>> /*-------------------------------------------------------------------------*/
>>
>> +static inline void endpoint_update(int edi,
>> +				   struct usb_host_endpoint **in,
>> +				   struct usb_host_endpoint **out,
>> +				   struct usb_host_endpoint *e)
>> +{
>> +	if (edi) {
>> +		if (!*in)
>> +			*in = e;
>> +	} else {
>> +		if (!*out)
>> +			*out = e;
>> +	}
>> +}
>> +
>>  static int
>>  get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
>>  {
>> -	int				tmp;
>> -	struct usb_host_interface	*alt;
>> -	struct usb_host_endpoint	*in, *out;
>> -	struct usb_host_endpoint	*iso_in, *iso_out;
>> -	struct usb_host_endpoint	*int_in, *int_out;
>> -	struct usb_device		*udev;
>> +	int                             tmp;
>> +	struct usb_host_interface       *alt;
>> +	struct usb_host_endpoint        *in, *out;
>> +	struct usb_host_endpoint        *iso_in, *iso_out;
>> +	struct usb_host_endpoint        *int_in, *int_out;
>> +	struct usb_device               *udev;
>
> unnecessary change
>
>>
>>  	for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
>> -		unsigned	ep;
>> +		unsigned        ep;
>
> unnecessary change
>
>>
>>  		in = out = NULL;
>>  		iso_in = iso_out = NULL;
>> @@ -150,48 +164,27 @@ get_endpoints(struct usbtest_dev *dev, struct  
>> usb_interface *intf)
>>  		 * ignore other endpoints and altsettings.
>>  		 */
>>  		for (ep = 0; ep < alt->desc.bNumEndpoints; ep++) {
>> -			struct usb_host_endpoint	*e;
>> +			struct usb_host_endpoint        *e;
>
> unnecessary change
>

I already sent the version 2 of this patch: https://lkml.org/lkml/2017/4/3/856

Thanks
--
Gustavo A. R. Silva





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ