From patchwork Fri Nov 4 11:43:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9412559 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 657AA60722 for ; Fri, 4 Nov 2016 11:44:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56EE12ADC3 for ; Fri, 4 Nov 2016 11:44:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B3592ADC8; Fri, 4 Nov 2016 11:44:11 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DFE372ADC3 for ; Fri, 4 Nov 2016 11:44:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2ctR-0007xk-5C; Fri, 04 Nov 2016 11:42:45 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2csT-0007hW-Dt for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2016 11:41:47 +0000 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id uA4Bf7HA017322; Fri, 4 Nov 2016 20:41:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com uA4Bf7HA017322 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1478259668; bh=xRuQblJWnFp6miOyP6eEcCa8PUwg1BKK+HZwWnp59Zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VIm+cJG5NswK0FA5a0EnIjUTXumOsEmcysT9FecIE5OQqc5MdZ5xWtTwbhiFZ/mmr /1XHDkAhZ/lMZDY1RllB3l35IkpunJFktvSUG8tdOK3yAL96YK82nHZlf3/f4bqVrI 0eNPcPIwF/RU/IGigs634MEymEB/M1XdbbC6idM5r+quJn4O3n/HCQdpLXdKW1/bow IiXSHRQj4oe2vMisT3PkAL0OIHUyE1+rP8sODxjLvkUxHWUDdlGgurd4mZs068weqb xnUOk9hGV4weXH2y4hUi8MXgGUpJ09fdEy94WMrt/tiiTKEU5a8GUmDTgytCejgk1o iaJoIvwsJB0KA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] ARM: cache-uniphier: refactor jump label to follow coding style guideline Date: Fri, 4 Nov 2016 20:43:35 +0900 Message-Id: <1478259816-24965-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478259816-24965-1-git-send-email-yamada.masahiro@socionext.com> References: <1478259816-24965-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161104_044145_907500_3F63A5D6 X-CRM114-Status: GOOD ( 10.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , Russell King , linux-kernel@vger.kernel.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 Documentation/CodingStyle recommends to use label names which say what the goto does or why the goto exists. Just in case, split it up into three labels because the CodingStyle says "one err bugs" is a common type of bug (although, I do not believe the current code includes such a bug). During the refactoring, iounmap(data->op_base) turned out to have no corresponding bail-out point, so remove it. Signed-off-by: Masahiro Yamada --- arch/arm/mm/cache-uniphier.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c index 58f2ddb..c71ab7c 100644 --- a/arch/arm/mm/cache-uniphier.c +++ b/arch/arm/mm/cache-uniphier.c @@ -387,21 +387,21 @@ static int __init __uniphier_cache_init(struct device_node *np, if (!data->ctrl_base) { pr_err("L%d: failed to map control register\n", *cache_level); ret = -ENOMEM; - goto err; + goto free_mem; } data->rev_base = of_iomap(np, 1); if (!data->rev_base) { pr_err("L%d: failed to map revision register\n", *cache_level); ret = -ENOMEM; - goto err; + goto unmap_ctrl; } data->op_base = of_iomap(np, 2); if (!data->op_base) { pr_err("L%d: failed to map operation register\n", *cache_level); ret = -ENOMEM; - goto err; + goto unmap_rev; } data->way_ctrl_base = data->ctrl_base + 0xc00; @@ -451,10 +451,12 @@ static int __init __uniphier_cache_init(struct device_node *np, of_node_put(next_np); return ret; -err: - iounmap(data->op_base); + +unmap_rev: iounmap(data->rev_base); +unmap_ctrl: iounmap(data->ctrl_base); +free_mem: kfree(data); return ret;