From patchwork Mon Jan 18 08:25:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 8053451 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 530C9BEEE5 for ; Mon, 18 Jan 2016 08:26:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6515E20259 for ; Mon, 18 Jan 2016 08:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53AA02021B for ; Mon, 18 Jan 2016 08:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754176AbcARI0O (ORCPT ); Mon, 18 Jan 2016 03:26:14 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:41924 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899AbcARIZq (ORCPT ); Mon, 18 Jan 2016 03:25:46 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O1502Y3Q3EWNL90@mailout3.samsung.com>; Mon, 18 Jan 2016 17:25:44 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.114]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 6A.AE.04790.881AC965; Mon, 18 Jan 2016 17:25:44 +0900 (KST) X-AuditID: cbfee691-f79766d0000012b6-18-569ca188f38f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 47.96.13906.881AC965; Mon, 18 Jan 2016 17:25:44 +0900 (KST) Received: from samsunx.samsung ([10.113.63.54]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O1500D463EM7R40@mmp2.samsung.com>; Mon, 18 Jan 2016 17:25:44 +0900 (KST) From: Andi Shyti To: linux-samsung-soc@vger.kernel.org Cc: Sangbeom Kim , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH 1/2] clk: s2mps11: remove redundant variable Date: Mon, 18 Jan 2016 17:25:24 +0900 Message-id: <1453105525-31506-2-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.6.4 In-reply-to: <1453105525-31506-1-git-send-email-andi.shyti@samsung.com> References: <1453105525-31506-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsWyRsSkSLdj4Zwwg1XX1S22H3nGarH4x3Mm i9cvDC0+9txjtbi8aw6bxYzz+5gsLp5ytbi44guTxY8z3SwOnB7vb7Sye1zu62XyuL7kE7NH 35ZVjB6fN8kFsEZx2aSk5mSWpRbp2yVwZay5Pp+toEWi4ue79cwNjC+Fuxg5OSQETCQezJrC AmGLSVy4t56ti5GLQ0hgBaPE9Y43TDBFM2f0sEAkZjFKLNj2kxnC+cgocXVbO1gVm4CmRNPt H2wgtoiAqsTntgXsIEXMAuuYJJ5tm8YIkhAWsJE4P/0uWBELUNGJf11Akzg4eAXcJKYv1gEx JQTkJCZNcACp4BRwl7j57g/YeCGgisY/qxhBRkoIrGOX2Np2nhlijIDEt8mHWCB6ZSU2HWCG OFpS4uCKGywTGIUXMDKsYhRNLUguKE5KLzLVK07MLS7NS9dLzs/dxAgM+9P/nk3cwXj/gPUh RgEORiUeXoezs8OEWBPLiitzDzGaAm2YyCwlmpwPjK68knhDYzMjC1MTU2Mjc0szJXFeHemf wUIC6Yklqd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s/3sHlpeePvOhdG7uqvtBzvtFL938MN3onBJLcUai oRZzUXEiAEuniNvDAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the probe function the s2mps11_clk pointer is used only to iterate through the s2mps11_clks. The naming itself brings confusion and the readability is not improved. Remove it, save some memory and headaches due to name similarity. Signed-off-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski --- drivers/clk/clk-s2mps11.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index d266299..ccb12f1 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -28,7 +28,7 @@ #include #include -#define s2mps11_name(a) (a->hw.init->name) +#define s2mps11_name(a) (a.hw.init->name) static struct clk **clk_table; static struct clk_onecell_data clk_data; @@ -177,18 +177,16 @@ static struct device_node *s2mps11_clk_parse_dt(struct platform_device *pdev, static int s2mps11_clk_probe(struct platform_device *pdev) { struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); - struct s2mps11_clk *s2mps11_clks, *s2mps11_clk; + struct s2mps11_clk *s2mps11_clks; unsigned int s2mps11_reg; struct clk_init_data *clks_init; int i, ret = 0; s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM, - sizeof(*s2mps11_clk), GFP_KERNEL); + sizeof(*s2mps11_clks), GFP_KERNEL); if (!s2mps11_clks) return -ENOMEM; - s2mps11_clk = s2mps11_clks; - clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM, sizeof(struct clk *), GFP_KERNEL); if (!clk_table) @@ -221,26 +219,26 @@ static int s2mps11_clk_probe(struct platform_device *pdev) if (IS_ERR(s2mps11_clks->clk_np)) return PTR_ERR(s2mps11_clks->clk_np); - for (i = 0; i < S2MPS11_CLKS_NUM; i++, s2mps11_clk++) { + for (i = 0; i < S2MPS11_CLKS_NUM; i++) { if (!clks_init[i].name) continue; /* Skip clocks not present in some devices */ - s2mps11_clk->iodev = iodev; - s2mps11_clk->hw.init = &clks_init[i]; - s2mps11_clk->mask = 1 << i; - s2mps11_clk->reg = s2mps11_reg; - - s2mps11_clk->clk = devm_clk_register(&pdev->dev, - &s2mps11_clk->hw); - if (IS_ERR(s2mps11_clk->clk)) { + s2mps11_clks[i].iodev = iodev; + s2mps11_clks[i].hw.init = &clks_init[i]; + s2mps11_clks[i].mask = 1 << i; + s2mps11_clks[i].reg = s2mps11_reg; + + s2mps11_clks[i].clk = devm_clk_register(&pdev->dev, + &s2mps11_clks[i].hw); + if (IS_ERR(s2mps11_clks[i].clk)) { dev_err(&pdev->dev, "Fail to register : %s\n", - s2mps11_name(s2mps11_clk)); - ret = PTR_ERR(s2mps11_clk->clk); + s2mps11_name(s2mps11_clks[i])); + ret = PTR_ERR(s2mps11_clks[i].clk); goto err_reg; } - s2mps11_clk->lookup = clkdev_create(s2mps11_clk->clk, - s2mps11_name(s2mps11_clk), NULL); - if (!s2mps11_clk->lookup) { + s2mps11_clks[i].lookup = clkdev_create(s2mps11_clks[i].clk, + s2mps11_name(s2mps11_clks[i]), NULL); + if (!s2mps11_clks[i].lookup) { ret = -ENOMEM; goto err_reg; }