From patchwork Mon Feb 12 14:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10213147 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 E210C60467 for ; Mon, 12 Feb 2018 14:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4BD128ACA for ; Mon, 12 Feb 2018 14:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8E3628ADA; Mon, 12 Feb 2018 14:59:50 +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 casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18B5828ACA for ; Mon, 12 Feb 2018 14:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=8ydR7S8yysPeIe0KyrRNG3GV8T9iib42JuPvCK2ifK8=; b=jsEV5lZcYQvUHzZIOzDQi2du4E 9kiuRA2s/GVKeZruhPT+Nh3jqNLtVU1rVSXXZ+MGTnUia4o9ztuiCykJ+Z0nuWG871IWINyDDXtHE LaliZn2DUhj9nT0F6Zg0JY3cgOtmExcntVQLu8ouz7jW7h6yDoQYS8PLjdqSeF0nutlZAYUOCsLlE 4iHhen66UdqITksIwphsxQ8RbWuX0ipj5wOwM6pvhHBwWc86+ORgSWPnabegs4nhHwgXBpopY0ycM aRi+Hq4C97AOi7usUmbKefS4dUrK5meq6EQOnKINiYO9vF1IAbwB5yLZB3Xn+02mdEzYOGEDWwTAY 66tG2mpQ==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elFZy-00020E-IW for patchwork-linux-amlogic@patchwork.kernel.org; Mon, 12 Feb 2018 14:59:38 +0000 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=8ydR7S8yysPeIe0KyrRNG3GV8T9iib42JuPvCK2ifK8=; b=Q+fdSpfOnoqO5BGOpCoNILTVq9 /X6ZQGhb9d6Qyrpxgq5pxkNtX4OPSoRJeXP3KxpWaAGz77mqwRpdlL3BQ/OePdA54Umxmz0Sq2E+q tO7i5Kksv4D4QwSm4tMlu9wDekNUjZaS3ZTHb1D49Ie7lma/Tj519gGXzKvqNx9VLChRR98ajT9k3 GJA57i323IN0BxrEINQyDybbXRA5D68+etXbNPPdrX8HsbwBz7hUv9lQmvWJ6JJ1rsBDlsdEHcWow bLMpBbeeXwUF59LiUkbQCCtZFUVfRX4kvc/2KqEr8d2WmLgZ3Ss6MtaoqU+OZ1w1pc9GGmOzO7lSH WRkHlaSg==; 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 1elFZp-0001cH-0r; Mon, 12 Feb 2018 14:59:29 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elFZP-0000BE-JZ for linux-amlogic@lists.infradead.org; Mon, 12 Feb 2018 14:59:07 +0000 Received: by mail-wr0-x242.google.com with SMTP id y3so15499082wrh.3 for ; Mon, 12 Feb 2018 06:58:54 -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=ITfljnTWXXx1peAxkmQKnxmAqTxINyPBQ0hb1QbZXt4=; b=Ku3SfbS0Wb+GUROZylXs9aHVb096y1sMBtW+OOQ05/Ij/02J8pXBJfoeiHd5xKwgWr iFEwsdgbmLxVYqk78RmWlcApgJ7qWhEjsur26KVzgYFxHfgAfp33hCeT+3CxGmSFm08Q U1k3dAiEIEggDG/mOUgQEv/9SbhU9tUuns1+Oiv7t24tOT+hqZuE6wNq7rnaPbHV9fS3 H7xF1wXV/2abeuDFO0XwXEVKLpbZ7MrunA6dBwJ4oEpMWOcCHrd/pDeLko6qxTXQDitZ hXC9CI/BkNGIeaKzcOVJo7BX3AXnNoeedljDWPXaYZuSHefuEJudlnJ//c/bPTIBuFsL PSKQ== 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=ITfljnTWXXx1peAxkmQKnxmAqTxINyPBQ0hb1QbZXt4=; b=TS76pc3MRIf2SmK1qUpiPg/dW34YV28X+XS4Ju6RtR1ASUzG94oVV7Ur+TWOVI8yCm 3MVMBHV6hNPbvTFyw1YZyxQuqcd+yC3aIebNkPxzMdjkoxP9YYlMeZV6V8UAEWb6VxaR WcN678wV3RGOTd0PlO0/gkNhOqR76fowrmpH7lWD6hNOznznIo/I7gwWD4D8Do/0Rocl /P1Dyr5HHEqHyInw1fsPsHXVZd5YtkY7xYnUt79zlgv5wP20PGxNy+HHqNBrtyXBSiZy T0RqLxGP6i5J+IqJuecHz3SYi3bB2SkL7WgEa9GJv0mPznzIXWIn3S/USr2hjUiShEEf sCIQ== X-Gm-Message-State: APf1xPDzHSxkp0ih7HHF7rN9K4uJWSRD0PxydTTeVWQrFhNqqmBh6WSP h/7E66XoBpU8+6cfndR5kzM3/Q== X-Google-Smtp-Source: AH8x2252Jz6YdYVo1vT0KkbNZuUq+oTBMOo2Qm3dVZtSh1QTFbeMhJu0t7dMt0iP4mUOyGp1tcUl/Q== X-Received: by 10.223.163.215 with SMTP id m23mr2609972wrb.90.1518447533218; Mon, 12 Feb 2018 06:58:53 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id p21sm4633218wmc.28.2018.02.12.06.58.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 06:58:52 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , Kevin Hilman Subject: [PATCH v2 03/19] clk: meson: only one loop index is necessary in probe Date: Mon, 12 Feb 2018 15:58:30 +0100 Message-Id: <20180212145846.19380-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180212145846.19380-1-jbrunet@baylibre.com> References: <20180212145846.19380-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 e16d53b6be30..3bb77b4f1e8d 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; }