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: <Pine.LNX.4.44L0.1408271058010.1460-100000@iolanthe.rowland.org>
Date:	Wed, 27 Aug 2014 11:03:03 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Michal Sojka <sojka@...ica.cz>
cc:	linux-usb@...r.kernel.org, Bryan Wu <cooloney@...il.com>,
	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Linux LED Subsystem <linux-leds@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <michal.vokac@...ap.cz>
Subject: Re: [PATCH v3 1/2] usb: gadget: Refactor request completion

On Wed, 27 Aug 2014, Michal Sojka wrote:

> All USB peripheral controller drivers called completion routines
> directly. This patch moves the completion call from drivers to
> usb_gadget_giveback_request(), in order to have a place where common
> functionality can be added.
> 
> All places in drivers/usb/ matching "[-.]complete(" were replaced with a
> call to usb_gadget_giveback_request(). This was compile-tested with all
> ARM drivers enabled and runtime-tested for musb.


> --- a/drivers/usb/gadget/udc/udc-core.c
> +++ b/drivers/usb/gadget/udc/udc-core.c
> @@ -102,6 +102,15 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
>  }
>  EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
>  
> +void usb_gadget_giveback_request(struct usb_ep *ep,
> +		struct usb_request *req)
> +{
> +	/* complete() is from gadget layer,
> +	 * eg fsg->bulk_in_complete() */

Wrong format for a multi-line comment.  It should look like this:

	/*
	 * Blah, blah, blah
	 * blah, blah, blah
	 */

Also, the reference to fsg is obsolete; the File-backed Storage Gadget 
is no longer in the kernel.  You might as well leave the comment out 
entirely.

> +	if (req->complete)

This test shouldn't be here.  The UDC drivers don't do it, but they
probably do check the req->complete isn't NULL when the request is
submitted.  In any case, if req->complete is NULL then we want to know
about it because it is a bug.  It should not be covered up silently.

> +		req->complete(ep, req);
> +}
> +EXPORT_SYMBOL_GPL(usb_gadget_giveback_request);
>  #endif	/* CONFIG_HAS_DMA */

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