Skip to contentSkip to conversation

hwmon: abx500: fix format string warnings

PATCH Applied Asaf Vertz 2 participants 2 messages Jan 21, 2015 Hardware monitoring

lore
Share & tools
lore

Asaf Vertz

author
#0 lore raw

PATCH 1/1 hwmon: abx500: fix format string warnings

Fixed the following warnings (reported by cppcheck):
[drivers/hwmon/abx500.c:224]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:233]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:242]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'.

---
 drivers/hwmon/abx500.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/abx500.c +3 -3
index 1387596..6cb89c0 100644
@@ -221,7 +221,7 @@ static ssize_t show_min(struct device *dev,
 	struct abx500_temp *data = dev_get_drvdata(dev);
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return sprintf(buf, "%ld\n", data->min[attr->index]);
+	return sprintf(buf, "%lu\n", data->min[attr->index]);
 }
 
 static ssize_t show_max(struct device *dev,
@@ -230,7 +230,7 @@ static ssize_t show_max(struct device *dev,
 	struct abx500_temp *data = dev_get_drvdata(dev);
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return sprintf(buf, "%ld\n", data->max[attr->index]);
+	return sprintf(buf, "%lu\n", data->max[attr->index]);
 }
 
 static ssize_t show_max_hyst(struct device *dev,
@@ -239,7 +239,7 @@ static ssize_t show_max_hyst(struct device *dev,
 	struct abx500_temp *data = dev_get_drvdata(dev);
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-	return sprintf(buf, "%ld\n", data->max_hyst[attr->index]);
+	return sprintf(buf, "%lu\n", data->max_hyst[attr->index]);
 }
 
 static ssize_t show_min_alarm(struct device *dev,
Signature · 7 lines
1.7.0.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Applied
#1 lore raw
Quoted 10 lines · Asaf Vertz

Fixed the following warnings (reported by cppcheck):
[drivers/hwmon/abx500.c:224]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:233]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [drivers/hwmon/abx500.c:242]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'.

---

Applied.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors