Skip to contentSkip to conversation

power: reset: pwr-mlxbf: change rst_pwr_hid and low_pwr_hid from global to local variables

PATCH In review Tom Rix 2 participants 2 messages Jun 29, 2022 System reset/shutdown drivers

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 power: reset: pwr-mlxbf: change rst_pwr_hid and low_pwr_hid from global to local variables

sparse reports
drivers/power/reset/pwr-mlxbf.c:19:12: warning: symbol 'rst_pwr_hid' was not declared. Should it be static? drivers/power/reset/pwr-mlxbf.c:20:12: warning: symbol 'low_pwr_hid' was not declared. Should it be static?

Both rst_pwr_hid and low_pwr_hid are only used in a single function so they should be local variables.

Fixes a4c0094fcf76 ("power: reset: pwr-mlxbf: add BlueField SoC power control driver")
---
 drivers/power/reset/pwr-mlxbf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/power/reset/pwr-mlxbf.c +2 -3
index 1c4904c0e1f5..12dedf841a44 100644
@@ -16,9 +16,6 @@
 #include <linux/reboot.h>
 #include <linux/types.h>
 
-const char *rst_pwr_hid = "MLNXBF24";
-const char *low_pwr_hid = "MLNXBF29";
-
 struct pwr_mlxbf {
 	struct work_struct send_work;
 	const char *hid;
@@ -31,6 +28,8 @@ static void pwr_mlxbf_send_work(struct work_struct *work)
 
 static irqreturn_t pwr_mlxbf_irq(int irq, void *ptr)
 {
+	const char *rst_pwr_hid = "MLNXBF24";
+	const char *low_pwr_hid = "MLNXBF29";
 	struct pwr_mlxbf *priv = ptr;
 
 	if (!strncmp(priv->hid, rst_pwr_hid, 8))
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw

-----Original Message-----
From: Tom Rix <[email protected]>
Sent: Wednesday, June 29, 2022 3:21 PM
To: [email protected]; Asmaa Mnebhi <[email protected]>
Cc: [email protected]; [email protected]; Tom Rix <[email protected]>
Subject: [PATCH] power: reset: pwr-mlxbf: change rst_pwr_hid and low_pwr_hid from global to local variables

sparse reports
drivers/power/reset/pwr-mlxbf.c:19:12: warning: symbol 'rst_pwr_hid' was not declared. Should it be static? drivers/power/reset/pwr-mlxbf.c:20:12: warning: symbol 'low_pwr_hid' was not declared. Should it be static?

Both rst_pwr_hid and low_pwr_hid are only used in a single function so they should be local variables.

Fixes a4c0094fcf76 ("power: reset: pwr-mlxbf: add BlueField SoC power control driver")
---
 drivers/power/reset/pwr-mlxbf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/power/reset/pwr-mlxbf.c +2 -4
@@ -16,9 +16,6 @@
 #include <linux/reboot.h>
 #include <linux/types.h>
 
-const char *rst_pwr_hid = "MLNXBF24";
-const char *low_pwr_hid = "MLNXBF29";
-
 struct pwr_mlxbf {
 	struct work_struct send_work;
 	const char *hid;
@@ -31,6 +28,8 @@ static void pwr_mlxbf_send_work(struct work_struct *work)
 
 static irqreturn_t pwr_mlxbf_irq(int irq, void *ptr)  {
+	const char *rst_pwr_hid = "MLNXBF24";
+	const char *low_pwr_hid = "MLNXBF29";
 	struct pwr_mlxbf *priv = ptr;
 
 	if (!strncmp(priv->hid, rst_pwr_hid, 8))
--

2.27.0