summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/dbgp.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-12 09:40:30 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 19:21:19 +0200
commitc6a76781da6b7ee2589a6ec87be30abdbc303384 (patch)
tree84443f9144aa0d260086e640fd0c9298b26e9ff3 /drivers/usb/gadget/dbgp.c
parentUSB: langwell: USB Client driver memory handling (diff)
downloadlinux-c6a76781da6b7ee2589a6ec87be30abdbc303384.tar.xz
linux-c6a76781da6b7ee2589a6ec87be30abdbc303384.zip
USB: gadget: dbgp: cleanup: remove unneeded check
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>
Diffstat (limited to 'drivers/usb/gadget/dbgp.c')
-rw-r--r--drivers/usb/gadget/dbgp.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/usb/gadget/dbgp.c b/drivers/usb/gadget/dbgp.c
index 0ed50a2c0a36..abe4a2ec5625 100644
--- a/drivers/usb/gadget/dbgp.c
+++ b/drivers/usb/gadget/dbgp.c
@@ -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,