Skip to contentSkip to conversation

hwmon: sparx5: Make symbol 's5_temp_match' static

PATCH Applied Wei Yongjun 2 participants 2 messages Jul 21, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: sparx5: Make symbol 's5_temp_match' static

The sparse tool complains as follows:

drivers/hwmon/sparx5-temp.c:150:27: warning:
symbol 's5_temp_match' was not declared. Should it be static?

This variable is not used outside of sparx5-temp.c, this commit marks it static.

Fixes c2cb4b5777e1 ("hwmon: sparx5: Add Sparx5 SoC temperature driver")
---
 drivers/hwmon/sparx5-temp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/sparx5-temp.c +1 -1
index 7d7a060259a8..1a2b1026b026 100644
@@ -147,7 +147,7 @@ static int s5_temp_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
-const struct of_device_id s5_temp_match[] = {
+static const struct of_device_id s5_temp_match[] = {
 	{ .compatible = "microchip,sparx5-temp" },
 	{},
 };
maintainer Applied
#1 lore raw
Quoted 11 lines · Wei Yongjun

The sparse tool complains as follows:

drivers/hwmon/sparx5-temp.c:150:27: warning:
symbol 's5_temp_match' was not declared. Should it be static?

This variable is not used outside of sparx5-temp.c, this commit marks it static.

Fixes c2cb4b5777e1 ("hwmon: sparx5: Add Sparx5 SoC temperature driver")

Applied.

Thanks,
Guenter

Quoted 17 lines
---
 drivers/hwmon/sparx5-temp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/sparx5-temp.c +1 -1
index 7d7a060259a8..1a2b1026b026 100644
@@ -147,7 +147,7 @@ static int s5_temp_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
-const struct of_device_id s5_temp_match[] = {
+static const struct of_device_id s5_temp_match[] = {
 	{ .compatible = "microchip,sparx5-temp" },
 	{},
 };