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: <op.v0c3sdm63l0zgt@mnazarewicz-glaptop>
Date:	Wed, 17 Aug 2011 16:27:39 +0200
From:	"Michal Nazarewicz" <mina86@...a86.com>
To:	"Alan Stern" <stern@...land.harvard.edu>
Cc:	"Sebastian Andrzej Siewior" <bigeasy@...utronix.de>,
	"Yang Rui Rui" <ruirui.r.yang@...to.com>,
	"Felipe Balbi" <balbi@...com>,
	"Greg Kroah-Hartman" <gregkh@...e.de>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: get rid of USB_GADGET_DUALSPEED and
 USB_GADGET_SUPERSPEED

> On Wed, 17 Aug 2011, Michal Nazarewicz wrote:
>> @@ -1609,8 +1603,7 @@ int usb_composite_probe(struct  
>> usb_composite_driver *driver,
>>  		driver->iProduct = driver->name;
>>  	composite_driver.function =  (char *) driver->name;
>>  	composite_driver.driver.name = driver->name;
>> -	composite_driver.speed = min((u8)composite_driver.speed,
>> -				     (u8)driver->max_speed);
>> +	composite_driver.speed = min(USB_SPEED_SUPER, driver->max_speed);

On Wed, 17 Aug 2011 16:20:15 +0200, Alan Stern <stern@...land.harvard.edu>  
wrote:
> I wonder if the min is needed here at all.  It doesn't seem to be doing
> any good.

Do you mean just doing “composite_driver.speed = driver->max_speed”?

>> --- a/drivers/usb/gadget/file_storage.c
>> +++ b/drivers/usb/gadget/file_storage.c
>> @@ -3562,11 +3562,7 @@ static void fsg_resume(struct usb_gadget *gadget)
>>  /*-------------------------------------------------------------------------*/
>>
>>  static struct usb_gadget_driver		fsg_driver = {
>> -#ifdef CONFIG_USB_GADGET_DUALSPEED
>>  	.speed		= USB_SPEED_HIGH,
>> -#else
>> -	.speed		= USB_SPEED_FULL,
>> -#endif
>>  	.function	= (char *) fsg_string_product,
>>  	.unbind		= fsg_unbind,
>>  	.disconnect	= fsg_disconnect,

> You mustn't remove the .speed field entirely.  Set it to USB_SPEED_HIGH.
> The same goes for the other drivers below.

Please note that the field is not in fact removed.

I've removed it in composite_driver only but that's because it is later
set in usb_composite_probe() (ie. see hunk above).

>> diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
>> index 1b24099..1869478 100644
>> --- a/drivers/usb/gadget/inode.c
>> +++ b/drivers/usb/gadget/inode.c
>
>> @@ -1015,9 +1013,8 @@ ep0_read (struct file *fd, char __user *buf,  
>> size_t len, loff_t *ptr)
>>  			if (dev->current_config) {
>>  				unsigned power;
>>
>> -				if (gadget_is_dualspeed(dev->gadget)
>> -						&& (dev->gadget->speed
>> -							== USB_SPEED_HIGH))
>> +				if (gadget_is_dualspeed(dev->gadget) &&
>> +				    (dev->gadget->speed == USB_SPEED_HIGH))
>>  					power = dev->hs_config->bMaxPower;
>>  				else
>>  					power = dev->config->bMaxPower;
>
> Please don't mix functional changes with cosmetic whitespace changes.

Will fix.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@...gle.com>-----ooO--(_)--Ooo--
--
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