Skip to contentSkip to conversation

power: supply: Make some symbols static

PATCH In review Qiheng Lin 3 participants 3 messages Apr 10, 2021 – Apr 12, 2021

Subsystems (4)
lore
Share & tools
lore

Qiheng Lin

author
#0 lore raw

PATCH 1/1 power: supply: Make some symbols static

The sparse tool complains as follows:

drivers/power/supply/surface_battery.c:700:1: warning:
symbol 'dev_attr_alarm' was not declared. Should it be static?
drivers/power/supply/surface_battery.c:805:1: warning:
symbol 'surface_battery_pm_ops' was not declared. Should it be static?

This symbol is not used outside of surface_battery.c, so this commit marks it static.

---
 drivers/power/supply/surface_battery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/surface_battery.c +2 -2
index 4116dd839ecd..7efa431a62b2 100644
@@ -697,7 +697,7 @@ static ssize_t alarm_store(struct device *dev, struct device_attribute *attr, co
 	return count;
 }
 
-DEVICE_ATTR_RW(alarm);
+static DEVICE_ATTR_RW(alarm);
 
 static struct attribute *spwr_battery_attrs[] = {
 	&dev_attr_alarm.attr,
@@ -802,7 +802,7 @@ static int __maybe_unused surface_battery_resume(struct device *dev)
 {
 	return spwr_battery_recheck_full(dev_get_drvdata(dev));
 }
-SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
+static SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
 
 static int surface_battery_probe(struct ssam_device *sdev)
 {
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Qiheng Lin

The sparse tool complains as follows:

drivers/power/supply/surface_battery.c:700:1: warning:
symbol 'dev_attr_alarm' was not declared. Should it be static?
drivers/power/supply/surface_battery.c:805:1: warning:
symbol 'surface_battery_pm_ops' was not declared. Should it be static?

Quoted 5 lines

This symbol is not used outside of surface_battery.c, so this commit marks it static.

Quoted 27 lines
---
  drivers/power/supply/surface_battery.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/surface_battery.c +2 -2
index 4116dd839ecd..7efa431a62b2 100644
@@ -697,7 +697,7 @@ static ssize_t alarm_store(struct device *dev, struct device_attribute *attr, co
  	return count;
  }
 
-DEVICE_ATTR_RW(alarm);
+static DEVICE_ATTR_RW(alarm);
 
  static struct attribute *spwr_battery_attrs[] = {
  	&dev_attr_alarm.attr,
@@ -802,7 +802,7 @@ static int __maybe_unused surface_battery_resume(struct device *dev)
  {
  	return spwr_battery_recheck_full(dev_get_drvdata(dev));
  }
-SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
+static SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
 
  static int surface_battery_probe(struct ssam_device *sdev)
  {
#2 lore raw

Hi,

Quoted 8 lines · Maximilian Luz
Quoted 7 lines · Qiheng Lin

The sparse tool complains as follows:

drivers/power/supply/surface_battery.c:700:1: warning:
symbol 'dev_attr_alarm' was not declared. Should it be static?
drivers/power/supply/surface_battery.c:805:1: warning:
symbol 'surface_battery_pm_ops' was not declared. Should it be static?

Quoted 7 lines
Quoted 5 lines

This symbol is not used outside of surface_battery.c, so this commit marks it static.

Thanks, queued.

-- Sebastian

Quoted 24 lines
Quoted 24 lines
---
  drivers/power/supply/surface_battery.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/surface_battery.c +2 -2
index 4116dd839ecd..7efa431a62b2 100644
@@ -697,7 +697,7 @@ static ssize_t alarm_store(struct device *dev, struct device_attribute *attr, co
  	return count;
  }
-DEVICE_ATTR_RW(alarm);
+static DEVICE_ATTR_RW(alarm);
  static struct attribute *spwr_battery_attrs[] = {
  	&dev_attr_alarm.attr,
@@ -802,7 +802,7 @@ static int __maybe_unused surface_battery_resume(struct device *dev)
  {
  	return spwr_battery_recheck_full(dev_get_drvdata(dev));
  }
-SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
+static SIMPLE_DEV_PM_OPS(surface_battery_pm_ops, NULL, surface_battery_resume);
  static int surface_battery_probe(struct ssam_device *sdev)
  {