All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] interconnect: imx: Reduce scope for the variable “dn” in imx_icc_node_init_qos()
@ 2020-12-06 17:11 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-12-06 17:11 UTC (permalink / raw)
  To: linux-pm, linux-arm-kernel, linux-imx, kernel, Alexandre Bailon,
	Dong Aisheng, Fabio Estevam, Georgi Djakov, Krzysztof Kozlowski,
	Leonard Crestez, Liu Shixin, Sascha Hauer, Shawn Guo,
	Wei Yongjun
  Cc: Christophe Jaillet, kernel-janitors, LKML

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-06 17:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 17:11 [PATCH] interconnect: imx: Reduce scope for the variable “dn” in imx_icc_node_init_qos() Markus Elfring

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.