Skip to contentSkip to conversation

watchdog: imx2_wdt: set variables imx_wdt* storage-class-specifier to static

PATCH In review Tom Rix 2 participants 2 messages Apr 8, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 watchdog: imx2_wdt: set variables imx_wdt* storage-class-specifier to static

smatch reports drivers/watchdog/imx2_wdt.c:442:22: warning: symbol
'imx_wdt' was not declared. Should it be static?
drivers/watchdog/imx2_wdt.c:446:22: warning: symbol
'imx_wdt_legacy' was not declared. Should it be static?

These variables are only used in one file so should be static.

---
 drivers/watchdog/imx2_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/imx2_wdt.c +2 -2
index 19ab7b3d286b..6fcc3596103c 100644
@@ -439,11 +439,11 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
 			 imx2_wdt_resume);
 
-struct imx2_wdt_data imx_wdt = {
+static struct imx2_wdt_data imx_wdt = {
 	.wdw_supported = true,
 };
 
-struct imx2_wdt_data imx_wdt_legacy = {
+static struct imx2_wdt_data imx_wdt_legacy = {
 	.wdw_supported = false,
 };
 
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tom Rix

smatch reports drivers/watchdog/imx2_wdt.c:442:22: warning: symbol
'imx_wdt' was not declared. Should it be static?
drivers/watchdog/imx2_wdt.c:446:22: warning: symbol
'imx_wdt_legacy' was not declared. Should it be static?

These variables are only used in one file so should be static.

We already have that at

https://patchwork.kernel.org/project/linux-watchdog/patch/[email protected]/

but I don't really care which one Wim picks up, so

Guenter

Quoted 22 lines
---
  drivers/watchdog/imx2_wdt.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/imx2_wdt.c +2 -2
index 19ab7b3d286b..6fcc3596103c 100644
@@ -439,11 +439,11 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
  static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
  			 imx2_wdt_resume);
 
-struct imx2_wdt_data imx_wdt = {
+static struct imx2_wdt_data imx_wdt = {
  	.wdw_supported = true,
  };
 
-struct imx2_wdt_data imx_wdt_legacy = {
+static struct imx2_wdt_data imx_wdt_legacy = {
  	.wdw_supported = false,
  };