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>] [day] [month] [year] [list]
Date:	Mon, 1 Nov 2010 15:53:00 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Tatyana Brokhman <tlinder@...eaurora.org>
cc:	USB list <linux-usb@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Michal Nazarewicz <m.nazarewicz@...sung.com>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC/PATCH v3 1/4] usb: Add usb_endpoint_descriptor to be part
 of the struct usb_ep

On Mon, 1 Nov 2010, Tatyana Brokhman wrote:

> Change usb_ep_enable() prototype to use endpoint descriptor from usb_ep.
> This optimization spares the FDs from saving the endpoint chosen
> descriptor. This optimization is not full though. To fully exploit this
> change one needs to update all the UDCs as well since in the current
> implementation each of them saves the endpoint descriptor in it's
> internal (and extended) endpoint structure.
> 
> Signed-off-by: Tatyana Brokhman <tlinder@...eaurora.org>


> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
> index a857b7a..edd8727 100644
> --- a/drivers/usb/gadget/file_storage.c
> +++ b/drivers/usb/gadget/file_storage.c
> @@ -2745,7 +2745,8 @@ static int enable_endpoint(struct fsg_dev *fsg, struct usb_ep *ep,
>  	int	rc;
>  
>  	ep->driver_data = fsg;
> -	rc = usb_ep_enable(ep, d);
> +	ep->desc = (struct usb_endpoint_descriptor *)d;
> +	rc = usb_ep_enable(ep);
>  	if (rc)
>  		ERROR(fsg, "can't enable %s, result %d\n", ep->name, rc);
>  	return rc;

Instead of casting the variable, you should remove the "const"  
qualifiers here and in the callers.  After all, if usb_ep_enable is 
going to change the descriptor then we shouldn't call it "const".

Alternatively, if usb_ep_enable _isn't_ going to change the descriptor 
then perhaps the new pointer added to usb_ep should be declared 
"const".

Alan Stern

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