From patchwork Wed Jan 31 18:09:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10194325 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 ACDD760380 for ; Wed, 31 Jan 2018 18:10:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 749C328771 for ; Wed, 31 Jan 2018 18:10:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66538287A8; Wed, 31 Jan 2018 18:10:33 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham 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 041CC28771 for ; Wed, 31 Jan 2018 18:10:33 +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=8eP/FQpJoHcQFhIjii8Tr9d30GqKpx0SNEVjKKrrlhE=; b=pqGDgOFc8nYHcsQFv6mQ338Lvc Vvv2/h6+1rJVtMqnupTtblXyUmvMjexlQyhafAcyZ0TM4XS/MKeG9hCTd1Z0TOzn3egG4bZoZnQRY 7RSyD7hQI+p5z33uyMW/lM7i3APhh4sCjnas8K2RZXXfaLgBFoK3castW9oP4EF8A2U4Jj4JwXW4v j8MpHtgMQtsWMX9i8OYf/lnf3F2AOZ4vjvwAinjDVW9eBq4hfmNJwMnYpgtUU2qax2JDcPr2FXCvX bNvUhUqsfQ1S52F2TKd9X+3x0PX03mHBe3dBz99tz+InreB1U4EWYqA9UqiDSNCcWZvnKuUi/0mu0 BnwvX2tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egwpt-0001ke-Tt; Wed, 31 Jan 2018 18:10:17 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egwph-0000Kb-P5 for linux-amlogic@lists.infradead.org; Wed, 31 Jan 2018 18:10:10 +0000 Received: by mail-wr0-x241.google.com with SMTP id 36so16036253wrh.1 for ; Wed, 31 Jan 2018 10:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=01ty/OQ+wCVmfw367gGl5UXJI0td1BrQUYLs9s91Cds=; b=RgJ/mnp9GZbPG+VGI2cw3u3O/m6Y6i2xzu7+zrOJnMb7B0CfPAnoc7nbCFbskEA86l liYfGD/48XII2p5qI6+FaL+pKCCeagMi+Cj7phjned/Dd8k0ByI798h3+byJl1iGS/CL IkUrAlNbly6DOt6P70nBAyjYEaw8WxCJKmzkHXuXJTQIb4J27kukFaTxM7M1Sj94VAWJ GtpnBVWYNTFH4PVBIU+MX1q2bgi/AjCWpDNY3wfBWWIRd/lYmWZ/Y0nsQcXScEwi+ZG/ UZaIdrfEdf2/qzqnB64uc0pPoMAruwnulD1o8xjx3qPyKXsEEmckFX+y/bgZEEaXeF42 cSMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=01ty/OQ+wCVmfw367gGl5UXJI0td1BrQUYLs9s91Cds=; b=W/TlkXnSu8kQEPhfh8V6fevUrqGaLoQaxZKMiNb8CPGDc8moPi64orn/QuobfjNG9x ioQoa6hX5c+Ei+uWy8G6zz2SUwbiyDe2bnnaVMDHJN+0m2pXEAbk361i+Pd9zqZYyPIZ hmDEVj3V0aiXKIu3UTOkwba6Yxs3kK0UvRaY04nSgvdKc9WIUutWZZA4Wz5lQEqh9lQd MRvHje3LdTivPiEMBgIAKBV85BuG/+/IhbMVZV+Vw7oV5gaOSSSAd5JmKQIWkCwxNbkk Fpvu64nm49uRmYSJy8NAi6Oq+sJb1pi7kCUvvCk31mfl2P2CQMST00AXcCTlCbJ2kBhm iNTg== X-Gm-Message-State: AKwxytdkB4fxhzeNfBcxwaTyjondLpwYm8vbbatImlrsuMnxgpXDx0I6 sNS4vwgDBcR+Pda4ZfDLw/2jkw== X-Google-Smtp-Source: AH8x224eXzUPEdqPtRFvob7DHTQTwP7/yFuJ0qssGFz2Z61cGVx45tW9CuCrs60EgQgFV9cqeabiuw== X-Received: by 10.223.175.196 with SMTP id y4mr22237114wrd.195.1517422192547; Wed, 31 Jan 2018 10:09:52 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id f8sm341977wmc.3.2018.01.31.10.09.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jan 2018 10:09:52 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , Kevin Hilman Subject: [PATCH 03/19] clk: meson: only one loop index is necessary in probe Date: Wed, 31 Jan 2018 19:09:29 +0100 Message-Id: <20180131180945.18025-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180131180945.18025-1-jbrunet@baylibre.com> References: <20180131180945.18025-1-jbrunet@baylibre.com> X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need several loop index variables in the probe function This is far from being critical but since we are doing a vast rework of meson clock controllers, now is the time to lower the entropy a bit Signed-off-by: Jerome Brunet --- drivers/clk/meson/axg.c | 8 ++++---- drivers/clk/meson/gxbb.c | 13 ++++++------- drivers/clk/meson/meson8b.c | 8 ++++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c index 2f2b3845c01d..81565b025b70 100644 --- a/drivers/clk/meson/axg.c +++ b/drivers/clk/meson/axg.c @@ -802,7 +802,7 @@ static int axg_clkc_probe(struct platform_device *pdev) const struct clkc_data *clkc_data; struct resource *res; void __iomem *clk_base; - int ret, clkid, i; + int ret, i; clkc_data = of_device_get_match_data(dev); if (!clkc_data) @@ -841,13 +841,13 @@ static int axg_clkc_probe(struct platform_device *pdev) clkc_data->clk_dividers[i]->reg = clk_base + (u64)clkc_data->clk_dividers[i]->reg; - for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) { + for (i = 0; i < clkc_data->hw_onecell_data->num; i++) { /* array might be sparse */ - if (!clkc_data->hw_onecell_data->hws[clkid]) + if (!clkc_data->hw_onecell_data->hws[i]) continue; ret = devm_clk_hw_register(dev, - clkc_data->hw_onecell_data->hws[clkid]); + clkc_data->hw_onecell_data->hws[i]); if (ret) { dev_err(dev, "Clock registration failed\n"); return ret; diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 17f44ac751b3..e6adab49c0ba 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -1947,7 +1947,7 @@ static int gxbb_clkc_probe(struct platform_device *pdev) { const struct clkc_data *clkc_data; void __iomem *clk_base; - int ret, clkid, i; + int ret, i; struct device *dev = &pdev->dev; clkc_data = of_device_get_match_data(dev); @@ -1988,16 +1988,15 @@ static int gxbb_clkc_probe(struct platform_device *pdev) for (i = 0; i < clkc_data->clk_audio_dividers_count; i++) clkc_data->clk_audio_dividers[i]->base = clk_base; - /* - * register all clks - */ - for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) { + + /* Register all clks */ + for (i = 0; i < clkc_data->hw_onecell_data->num; i++) { /* array might be sparse */ - if (!clkc_data->hw_onecell_data->hws[clkid]) + if (!clkc_data->hw_onecell_data->hws[i]) continue; ret = devm_clk_hw_register(dev, - clkc_data->hw_onecell_data->hws[clkid]); + clkc_data->hw_onecell_data->hws[i]); if (ret) goto iounmap; } diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index abac079ff77f..ffadad27375e 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -806,7 +806,7 @@ static const struct reset_control_ops meson8b_clk_reset_ops = { static int meson8b_clkc_probe(struct platform_device *pdev) { - int ret, clkid, i; + int ret, i; struct clk_hw *parent_hw; struct clk *parent_clk; struct device *dev = &pdev->dev; @@ -844,13 +844,13 @@ static int meson8b_clkc_probe(struct platform_device *pdev) * register all clks * CLKID_UNUSED = 0, so skip it and start with CLKID_XTAL = 1 */ - for (clkid = CLKID_XTAL; clkid < CLK_NR_CLKS; clkid++) { + for (i = CLKID_XTAL; i < CLK_NR_CLKS; i++) { /* array might be sparse */ - if (!meson8b_hw_onecell_data.hws[clkid]) + if (!meson8b_hw_onecell_data.hws[i]) continue; /* FIXME convert to devm_clk_register */ - ret = devm_clk_hw_register(dev, meson8b_hw_onecell_data.hws[clkid]); + ret = devm_clk_hw_register(dev, meson8b_hw_onecell_data.hws[i]); if (ret) return ret; }