summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2022-06-29 15:20:45 -0400
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-06-29 21:41:59 +0200
commita578cc3af5cea5c7a912d2cfb8601875eb8ce451 (patch)
tree25c4695eac9b478def5ff363cb717d931f2dff08
parenta5a3d94fc4edecb894bc79810aea511ff9261c09 (diff)
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") Signed-off-by: Tom Rix <trix@redhat.com> Acked-by: Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/reset/pwr-mlxbf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/power/reset/pwr-mlxbf.c b/drivers/power/reset/pwr-mlxbf.c
index 1c4904c0e1f5..12dedf841a44 100644
--- a/drivers/power/reset/pwr-mlxbf.c
+++ b/drivers/power/reset/pwr-mlxbf.c
@@ -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))