* [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch issues
@ 2012-01-08 18:34 Frans Meulenbroeks
2012-01-09 1:48 ` [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Frans Meulenbroeks @ 2012-01-08 18:34 UTC (permalink / raw)
To: lm-sensors
fixed:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#162: FILE: i5k_amb.c:162:
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#178: FILE: i5k_amb.c:178:
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#194: FILE: i5k_amb.c:194:
+ unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
total: 0 errors, 3 warnings, 609 lines checked
i5k_amb.c has style problems, please review.
If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
---
drivers/hwmon/i5k_amb.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
index d22f241..c516bdc 100644
--- a/drivers/hwmon/i5k_amb.c
+++ b/drivers/hwmon/i5k_amb.c
@@ -159,7 +159,11 @@ static ssize_t store_amb_min(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
- unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+ unsigned long temp;
+ int ret = kstrtoul(buf, 10, &temp);
+ if (ret < 0)
+ return ret;
+ temp = temp / 500;
if (temp > 255)
temp = 255;
@@ -175,7 +178,11 @@ static ssize_t store_amb_mid(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
- unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+ unsigned long temp;
+ int ret = kstrtoul(buf, 10, &temp);
+ if (ret < 0)
+ return ret;
+ temp = temp / 500;
if (temp > 255)
temp = 255;
@@ -191,7 +197,11 @@ static ssize_t store_amb_max(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
- unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
+ unsigned long temp;
+ int ret = kstrtoul(buf, 10, &temp);
+ if (ret < 0)
+ return ret;
+ temp = temp / 500;
if (temp > 255)
temp = 255;
--
1.7.8.2
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch
2012-01-08 18:34 [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch issues Frans Meulenbroeks
@ 2012-01-09 1:48 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2012-01-09 1:48 UTC (permalink / raw)
To: lm-sensors
On Sun, Jan 08, 2012 at 01:34:20PM -0500, Frans Meulenbroeks wrote:
> fixed:
> WARNING: simple_strtoul is obsolete, use kstrtoul instead
> #162: FILE: i5k_amb.c:162:
> + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
>
> WARNING: simple_strtoul is obsolete, use kstrtoul instead
> #178: FILE: i5k_amb.c:178:
> + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
>
> WARNING: simple_strtoul is obsolete, use kstrtoul instead
> #194: FILE: i5k_amb.c:194:
> + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
>
> total: 0 errors, 3 warnings, 609 lines checked
>
> i5k_amb.c has style problems, please review.
>
> If any of these errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
> ---
Hi Frans,
I applied the entire series. I'll have to wait until the commit window closes
before I can push it to my kernel.org repository. For now, the up-to-date
repository is available at git://github.com/groeck/linux.git (branch hwmon or hwmon-next).
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-09 1:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-08 18:34 [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch issues Frans Meulenbroeks
2012-01-09 1:48 ` [lm-sensors] [PATCH 17/17 v3] hwmon: (i5k_amb) fix checkpatch Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.