Skip to content

Commit

Permalink
power: reset: pwr-mlxbf: change rst_pwr_hid and low_pwr_hid from glob…
Browse files Browse the repository at this point in the history
…al 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: a4c0094 ("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>
  • Loading branch information
Tom Rix authored and Sebastian Reichel committed Jun 29, 2022
1 parent a5a3d94 commit a578cc3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/power/reset/pwr-mlxbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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))
Expand Down

0 comments on commit a578cc3

Please sign in to comment.