All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-imx@nxp.com, kernel@pengutronix.de,
	Alexandre Bailon <abailon@baylibre.com>,
	Dong Aisheng <aisheng.dong@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Georgi Djakov <georgi.djakov@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	Liu Shixin <liushixin2@huawei.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Wei Yongjun <weiyongjun1@huawei.com>
Cc: Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] interconnect: imx: Reduce scope for the variable “dn” in imx_icc_node_init_qos()
Date: Sun, 6 Dec 2020 18:11:00 +0100	[thread overview]
Message-ID: <9bdbe83b-794b-6c6f-5ce4-fda87174bcb6@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 drivers/interconnect/imx/imx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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);
--
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

                 reply	other threads:[~2020-12-06 17:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bdbe83b-794b-6c6f-5ce4-fda87174bcb6@web.de \
    --to=markus.elfring@web.de \
    --cc=abailon@baylibre.com \
    --cc=aisheng.dong@nxp.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=festevam@gmail.com \
    --cc=georgi.djakov@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=liushixin2@huawei.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.