usb: musb: gadget: kill duplicate code in musb_gadget_queue()
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 24 Sep 2010 10:44:11 +0000 (13:44 +0300)
committerFelipe Balbi <balbi@ti.com>
Mon, 8 Nov 2010 07:29:55 +0000 (09:29 +0200)
musb_gadget_queue() checks for '!req->buf' condition twice:
in the second case the code is both duplicated and unreachable
as the first check returns early.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c

index f37b859..36cfd06 100644 (file)
@@ -1169,8 +1169,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
                                                : DMA_FROM_DEVICE);
                        request->mapped = 0;
                }
-       } else if (!req->buf) {
-               return -ENODATA;
        } else
                request->mapped = 0;