From patchwork Sat Mar 25 00:05:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9644309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E501F60327 for ; Sat, 25 Mar 2017 00:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D684F26907 for ; Sat, 25 Mar 2017 00:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB47B26CF9; Sat, 25 Mar 2017 00:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67ADD27C0B for ; Sat, 25 Mar 2017 00:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LnASsFvcs5w7EmbAoGggKUHhhSYu9TM5SFrSynNgrBE=; b=XAiwkD5hUnXH+1udavqSpDTsgd jK1zlfvKrH2RmRMWk3sfSkdGWZLvr73qgGyszWM7zGsAO/MZaqU24rfxx41HWO+wq0bS8I8UZkJI8 XNKhDzFPUZfD8bTFY1Z44qxCzzsf7JJU40vjo3UjXFVQTzX+M+7ymnCUrMpL2ZM0wc2CnLh/WfffT DSKKDhVJpQPyjZ3TeHyzNOOj/ykGzkGvTyqnqRFQ1jjlCURqrwHekc9NiE/QVkdwDLIOqgBjOeURb a8APyBaOt34Zdbpl2yo5fdqhg3BtGpx6VwB9FAj+AVl59qhHjq55zdJh2qTPphRkFJK9oUDzxLuhf Le/pwLkQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZEi-0004c1-BP; Sat, 25 Mar 2017 00:07:16 +0000 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49] helo=osg.samsung.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZDQ-0002k5-4y for linux-arm-kernel@lists.infradead.org; Sat, 25 Mar 2017 00:06:05 +0000 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id A0468A05F3; Sat, 25 Mar 2017 00:05:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6QdQy_ZlVX1U; Sat, 25 Mar 2017 00:05:42 +0000 (UTC) Received: from localhost.localdomain (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by osg.samsung.com (Postfix) with ESMTPSA id 8AE16A05EE; Sat, 25 Mar 2017 00:05:41 +0000 (UTC) From: Shuah Khan To: balbi@kernel.org, gregkh@linuxfoundation.org, kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com Subject: [PATCH 6/7] usb: dwc3: gadget: change goto labels in this file to meaningful names Date: Fri, 24 Mar 2017 18:05:04 -0600 Message-Id: <683bd245ba40d23fc0529be846dab70a096ab2d2.1490387086.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_170557_056507_41E1049D X-CRM114-Status: UNSURE ( 8.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, Shuah Khan , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Change goto labels in this file to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/gadget.c | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8d44a2f..9795226 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1345,19 +1345,19 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, if (r == req) { /* wait until it is processed */ dwc3_stop_active_transfer(dwc, dep->number, true); - goto out1; + goto gadget_giveback; } dev_err(dwc->dev, "request %p was not queued to %s\n", request, ep->name); ret = -EINVAL; - goto out0; + goto return_ret; } -out1: +gadget_giveback: /* giveback the request */ dwc3_gadget_giveback(dep, req, -ECONNRESET); -out0: +return_ret: spin_unlock_irqrestore(&dwc->lock, flags); return ret; @@ -1811,14 +1811,14 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) ret = __dwc3_gadget_ep_enable(dep, false, false); if (ret) { dev_err(dwc->dev, "failed to enable %s\n", dep->name); - goto err0; + goto return_ret; } dep = dwc->eps[1]; ret = __dwc3_gadget_ep_enable(dep, false, false); if (ret) { dev_err(dwc->dev, "failed to enable %s\n", dep->name); - goto err1; + goto ep_disable; } /* begin to receive SETUP packets */ @@ -1829,10 +1829,10 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) return 0; -err1: +ep_disable: __dwc3_gadget_ep_disable(dwc->eps[0]); -err0: +return_ret: return ret; } @@ -1850,7 +1850,7 @@ static int dwc3_gadget_start(struct usb_gadget *g, if (ret) { dev_err(dwc->dev, "failed to request irq #%d --> %d\n", irq, ret); - goto err0; + goto return_ret; } spin_lock_irqsave(&dwc->lock, flags); @@ -1859,7 +1859,7 @@ static int dwc3_gadget_start(struct usb_gadget *g, dwc->gadget.name, dwc->gadget_driver->driver.name); ret = -EBUSY; - goto err1; + goto irq_free; } dwc->gadget_driver = driver; @@ -1871,11 +1871,11 @@ static int dwc3_gadget_start(struct usb_gadget *g, return 0; -err1: +irq_free: spin_unlock_irqrestore(&dwc->lock, flags); free_irq(irq, dwc); -err0: +return_ret: return ret; } @@ -3063,7 +3063,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) irq = dwc3_gadget_get_irq(dwc); if (irq < 0) { ret = irq; - goto err0; + goto return_ret; } dwc->irq_gadget = irq; @@ -3073,7 +3073,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) if (!dwc->ctrl_req) { dev_err(dwc->dev, "failed to allocate ctrl request\n"); ret = -ENOMEM; - goto err0; + goto return_ret; } dwc->ep0_trb = dma_alloc_coherent(dwc->sysdev, @@ -3082,13 +3082,13 @@ int dwc3_gadget_init(struct dwc3 *dwc) if (!dwc->ep0_trb) { dev_err(dwc->dev, "failed to allocate ep0 trb\n"); ret = -ENOMEM; - goto err1; + goto free_ctrl_req; } dwc->setup_buf = kzalloc(DWC3_EP0_BOUNCE_SIZE, GFP_KERNEL); if (!dwc->setup_buf) { ret = -ENOMEM; - goto err2; + goto free_ep0_trb; } dwc->ep0_bounce = dma_alloc_coherent(dwc->sysdev, @@ -3097,20 +3097,20 @@ int dwc3_gadget_init(struct dwc3 *dwc) if (!dwc->ep0_bounce) { dev_err(dwc->dev, "failed to allocate ep0 bounce buffer\n"); ret = -ENOMEM; - goto err3; + goto free_setup_buf; } dwc->zlp_buf = kzalloc(DWC3_ZLP_BUF_SIZE, GFP_KERNEL); if (!dwc->zlp_buf) { ret = -ENOMEM; - goto err4; + goto free_ep0_bounce; } dwc->bounce = dma_alloc_coherent(dwc->sysdev, DWC3_BOUNCE_SIZE, &dwc->bounce_addr, GFP_KERNEL); if (!dwc->bounce) { ret = -ENOMEM; - goto err5; + goto free_zlp_buf; } init_completion(&dwc->ep0_in_setup); @@ -3150,39 +3150,39 @@ int dwc3_gadget_init(struct dwc3 *dwc) ret = dwc3_gadget_init_endpoints(dwc, dwc->num_eps); if (ret) - goto err6; + goto free_bounce; ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget); if (ret) { dev_err(dwc->dev, "failed to register udc\n"); - goto err6; + goto free_bounce; } return 0; -err6: +free_bounce: dma_free_coherent(dwc->sysdev, DWC3_BOUNCE_SIZE, dwc->bounce, dwc->bounce_addr); -err5: +free_zlp_buf: kfree(dwc->zlp_buf); -err4: +free_ep0_bounce: dwc3_gadget_free_endpoints(dwc); dma_free_coherent(dwc->sysdev, DWC3_EP0_BOUNCE_SIZE, dwc->ep0_bounce, dwc->ep0_bounce_addr); -err3: +free_setup_buf: kfree(dwc->setup_buf); -err2: +free_ep0_trb: dma_free_coherent(dwc->sysdev, sizeof(*dwc->ep0_trb) * 2, dwc->ep0_trb, dwc->ep0_trb_addr); -err1: +free_ctrl_req: dma_free_coherent(dwc->sysdev, sizeof(*dwc->ctrl_req), dwc->ctrl_req, dwc->ctrl_req_addr); -err0: +return_ret: return ret; }