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: 80846 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1103310qge; Fri, 4 Nov 2016 04:42:51 -0700 (PDT) X-Received: by 10.99.221.85 with SMTP id g21mr21494034pgj.121.1478259771212; Fri, 04 Nov 2016 04:42:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si16005977pfj.64.2016.11.04.04.42.50; Fri, 04 Nov 2016 04:42:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761973AbcKDLme (ORCPT + 27 others); Fri, 4 Nov 2016 07:42:34 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:26855 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761439AbcKDLmV (ORCPT ); Fri, 4 Nov 2016 07:42:21 -0400 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 Cc: Masahiro Yamada , Russell King , linux-kernel@vger.kernel.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 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;