USB: gadget: dbgp: cleanup: remove unneeded check
authorDan Carpenter <error27@gmail.com>
Thu, 12 Aug 2010 07:40:30 +0000 (09:40 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:21:19 +0000 (10:21 -0700)
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>
drivers/usb/gadget/dbgp.c

index 0ed50a2c0a361eee66f606430655065147a15c8c..abe4a2ec56254e62bbc8e3b60784c8a36a854d59 100644 (file)
@@ -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,