Skip to content

Commit

Permalink
USB: gadget: dbgp: cleanup: remove unneeded check
Browse files Browse the repository at this point in the history
len is always greater than or equal to zero here.  First of all, it's
type is unsigned and also we only assign it numbers which are greater
than or equal to zero.

Removing the check lets us pull everything in an indent level.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephane duverger <stephane.duverger@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 912c93d commit c6a7678
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/usb/gadget/dbgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,13 @@ static int dbgp_setup(struct usb_gadget *gadget,
} else
goto fail;

if (len >= 0) {
req->length = min(length, len);
req->zero = len < req->length;
if (data && req->length)
memcpy(req->buf, data, req->length);

req->complete = dbgp_setup_complete;
return usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
}
req->length = min(length, len);
req->zero = len < req->length;
if (data && req->length)
memcpy(req->buf, data, req->length);

req->complete = dbgp_setup_complete;
return usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);

fail:
dev_dbg(&dbgp.gadget->dev,
Expand Down

0 comments on commit c6a7678

Please sign in to comment.