From patchwork Sun Dec 6 17:11:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 11954183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CC1C4361B for ; Sun, 6 Dec 2020 17:13:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BCC2224DF for ; Sun, 6 Dec 2020 17:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BCC2224DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=vJ4uXmV5he9ylSyDAuYYS6QdrnvAEEFvqhETudgpjok=; b=Ng83PPruYlwhamCz8mxcgwSvA9 sh8osJOxoCX/hHdKwyz81Mf8A0z/WY8kXRZS8UYX2GhXQGvc1JWIq0KnBaxQNMFGy5F22lYorYhqs veacng4+EbqeIGNUCEAhN5jwjr10uDouB5sxwySV62wk/WMRotL62MsIG45nWVifB0+9murTniw84 KoDSiRQpZBekBzSE9Z/IFQnJO8p0HIha4TmaBoe4D2230sRQiOjpWSzvrPalCKaxcfRVXOS9/D9ZG 9yQjjW2UjMmeAlv+sJFby1nhTX6pcxX7TgWKaTrbKjD7lVaea/DUYPidv5Q6mz/P+yHPI+8GrtAZ8 Qsp426ag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klxZe-0007hU-BB; Sun, 06 Dec 2020 17:11:50 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klxZc-0007h2-JA for linux-arm-kernel@merlin.infradead.org; Sun, 06 Dec 2020 17:11:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:Cc:From:To:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=3AsZnBMpKd8Z7HSOamncAv6457FqKowJxhJSWVCvL38=; b=oC4zSzPYOYQy0OD9U3T3bDu7Uv ooJVShXZq/vEGaBBr5w7/cIUG9Rtoh1350zl7EGbNWqhP8vW7RR0CvVt2KUQjWzzgm6VZ4jjS0NmM BChkkxnmOCmusvB7McqhKDF7M7/3me1wBLReeWm9aZ42+Cmnc9OcrMmX1QjJqP09eHpsfWvH3/Yuv M2Tw1XzeWwMZwXmWV25RuLw0hrzGsyuU1+R/2b6Tg06vSpaRHCaqmD4brZ/IRPuKn8NY1nJQ573/H UVniNIxnJV7zovDZawbzsEjqRtWLL1Jn7MqN1A9jywS0VboflLyv6hRqgIntaNy+Q4ENWMdS8a1ZT 82OC/Qkw==; Received: from mout.web.de ([217.72.192.78]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klxZW-0001dN-7E for linux-arm-kernel@lists.infradead.org; Sun, 06 Dec 2020 17:11:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1607274672; bh=Q24nQqowZ9Kx8mI7xtEuBVHS976uLP33tPQxfpekXOk=; h=X-UI-Sender-Class:To:From:Cc:Subject:Date; b=LF12wqmZsy8Ovv+ERa8+RWqnhH0wL4BQDmk3uj7LEJwnMsKkFtEuIKFjbP+B2PmaM 3ZK6avSC06VtQJRtQbvoCuXhLzYf8Vjf+8ygCTSImuK8zDiOXLCDstf7E3JEG5g0i5 +hMvYb4ztv9TQuq0uOwhj/NzenAYlNkSmguhNSZg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.49.88.79]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MAcpW-1ksbOa2Ruy-00BEII; Sun, 06 Dec 2020 18:11:12 +0100 To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, kernel@pengutronix.de, Alexandre Bailon , Dong Aisheng , Fabio Estevam , Georgi Djakov , Krzysztof Kozlowski , Leonard Crestez , Liu Shixin , Sascha Hauer , Shawn Guo , Wei Yongjun From: Markus Elfring Subject: =?utf-8?q?=5BPATCH=5D_interconnect=3A_imx=3A_Reduce_scope_for_the_v?= =?utf-8?q?ariable_=E2=80=9Cdn=E2=80=9D_in_imx=5Ficc=5Fnode=5Finit=5Fqos=28?= =?utf-8?q?=29?= Message-ID: <9bdbe83b-794b-6c6f-5ce4-fda87174bcb6@web.de> Date: Sun, 6 Dec 2020 18:11:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K1:PFwuJkMQCbpn05aCTf1iEf8gXmopQPxcYK1SureoWWb4NQiTUYz +JJKWRUAwLT3vEak0WrmsYilXL5fU9WhhaWVZoq5NNJiJq2G1g9j+ktndEMAuogNEoIXHoe i2Q8HQ92D1xVjkV5bZjylzl42GvK6miEGKb8BU7kmPzB2oMb1S6nVwRIn71lc1xQh5O2qgg YK0yHHceQuaiaQoqL6jDQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:0aDIavloLHo=:/H16lIwRDm3bCynaekEXd3 XFi3mkgqrHYW14VrhujNt7z9FkHl93aKrxRxg+mwR4bVc26yJjRotTK3KVs6VSI9QqqjzhzaF s3o6Z/LdDf8LLhPujurLDbH2XY7WsgRRhRgNZBrNuLKSQcbS2075b+1VlOJ+4o0TKo0S2ZNdR whDn9vvQT0jpG9DDeFauPbi2hOMLaVnlwDrEkHMSPqJ+gELo4W+ifGK2hU+Ki2H7XdSoTYZZ+ WRkbr2dwgDpA3BfQH1eoFyEVSyhkd4j9aFY4aRF62MUtAsBNf8SUgoXTiSwYvVLu0Dl4HZumc un8YWFTaMsXgyiw+7++Sjd3ibJtvJMafiS9Mfmlq0Sh0Ab2afhIvPl22wT2Gqg/P3ikhubUhs G2mMojxIR+Lb0mOlHR5a0EmVP42n2xO8Qt9rVCI3nvng1keSuHx+k+suA+xybxmedSZee/7He jp8b7I2vbNCOefcUiMFydFQNBjmaJrOAWKgl6qxlwtz7tAp96kT22NNQ6wc8ZxMKVv8W1nOlZ fgkTiqOCE4BuHNWVeTqXlN+rEst/ScKbgDVSF/Biabf9AKxFzqZVrdIM4mC7uLjNTew/bNxMu /gOWhftiEBDNrWD2kM4ptwjEn6vXRNEGIIuE3epmIkyp50vQHZiv73OCE4xVU1JyHeMaoisfu s48YAfEZBPEKfZPxCCvBBCE9oiuzrDEdfYYiZSN48VwHXTngpeHd5HyZgrGYYCBL07eorosuF VnNwElVq9ynovrmR9noIO+s+q9Jk/KFM0OF/h15wGtw8Bm+FWSnNiEGmLETOUgQRxijdFBtni VmTy/oQBpHEqHzAg48H6zqKrjCRf0ZVL6Za2K+LAkuh7xNxpoLJGV9AwPnOakLOldujGIo6aU LVZvc70KtXMS17lJqKRQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201206_171143_458908_F0C3910D X-CRM114-Status: GOOD ( 10.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe Jaillet , kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Elfring Date: Sun, 6 Dec 2020 17:57:19 +0100 A local variable was used only within a single else branch. Thus move the definition for the variable “dn” into the corresponding code block. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/interconnect/imx/imx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.29.2 diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index 41dba7090c2a..6b0ac0feb4bc 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -81,7 +81,6 @@ static int imx_icc_node_init_qos(struct icc_provider *provider, struct imx_icc_node *node_data = node->data; const struct imx_icc_node_adj_desc *adj = node_data->desc->adj; struct device *dev = provider->dev; - struct device_node *dn = NULL; struct platform_device *pdev; if (adj->main_noc) { @@ -89,7 +88,9 @@ static int imx_icc_node_init_qos(struct icc_provider *provider, dev_dbg(dev, "icc node %s[%d] is main noc itself\n", node->name, node->id); } else { - dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0); + struct device_node *dn = of_parse_phandle(dev->of_node, + adj->phandle_name, + 0); if (!dn) { dev_warn(dev, "Failed to parse %s\n", adj->phandle_name);