lkml.org 
[lkml]   [2010]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] usb: dummy_hcd code simplification
On Tue, 19 Oct 2010, Tatyana Brokhman wrote:

> Take handling of the control requests out from dummy_timer to a different
> function.
>
> Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
> ---
> drivers/usb/gadget/dummy_hcd.c | 250 +++++++++++++++++++++-------------------
> 1 files changed, 134 insertions(+), 116 deletions(-)
>
> diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
> index dc65462..ff93fea 100644
> --- a/drivers/usb/gadget/dummy_hcd.c
> +++ b/drivers/usb/gadget/dummy_hcd.c
> @@ -1195,6 +1195,138 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)
> #define Ep_Request (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT)
> #define Ep_InRequest (Ep_Request | USB_DIR_IN)
>
> +
> +/**
> + * handle_control_request() - handles all control transferes
> + *

There should not be a blank line here.

> + * @dum - pointer to dummy (the_controller)
> + * @urb - the urb request to handle

Where's the line for "setup"?

> + * @status - pointer to request handling status

In each of these there should be a ':' following the variable name,
not a space and a '-'. Honestly, I can't see why you have so much
trouble copying the format of existing kerneldoc entries.

> + *
> + * Return 0 - if the request was handled
> + * 1 - if the request wasn't handles
> + * error code on error
> + */
> +static int handle_control_request(struct dummy *dum, struct urb *urb,
> + struct usb_ctrlrequest setup,

Don't pass "setup" by value! Pass it by reference, i.e., pass a
pointer to the "setup" variable in dummy_timer().

> + int *status)
> +{

The rest of this is okay.

Alan Stern



\
 
 \ /
  Last update: 2010-10-19 17:11    [W:2.931 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site