public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 1/2] hwmon: (w83627ehf) Replace deprecated strict_strto*
@ 2012-01-14  1:39 Alex Rio
  2012-01-14 17:25 ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Rio @ 2012-01-14  1:39 UTC (permalink / raw)
  To: khali, guenter.roeck; +Cc: linux-kernel

Replaces deprecated function strict_strto* to kstrto*. In the future
the strict_strto could disappear so the replacement was done.
I'm not sure if this is being done for all the files in a single
patch, anyway I'm including it here just in case.
Checkpatch.pl now leaves 5 "errors", they are mostly
assignments inside if's statements, taking them out does not
significantly increases readability.

Signed-off-by: Alex Rio <scasbyte@gmail.com>
---
 drivers/hwmon/w83627ehf.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 93f5fc7..0e0af04 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -937,7 +937,7 @@ store_in_##reg(struct device *dev, struct
device_attribute *attr, \
 	int nr = sensor_attr->index; \
 	unsigned long val; \
 	int err; \
-	err = strict_strtoul(buf, 10, &val); \
+	err = kstrtoul(buf, 10, &val); \
 	if (err < 0) \
 		return err; \
 	mutex_lock(&data->update_lock); \
@@ -1054,7 +1054,7 @@ store_fan_min(struct device *dev, struct
device_attribute *attr,
 	unsigned int reg;
 	u8 new_div;

-	err = strict_strtoul(buf, 10, &val);
+	err = kstrtoul(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1199,7 +1199,7 @@ store_##reg(struct device *dev, struct
device_attribute *attr, \
 	int nr = sensor_attr->index; \
 	int err; \
 	long val; \
-	err = strict_strtol(buf, 10, &val); \
+	err = kstrtol(buf, 10, &val); \
 	if (err < 0) \
 		return err; \
 	mutex_lock(&data->update_lock); \
@@ -1324,7 +1324,7 @@ store_pwm_mode(struct device *dev, struct
device_attribute *attr,
 	int err;
 	u16 reg;

-	err = strict_strtoul(buf, 10, &val);
+	err = kstrtoul(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1351,7 +1351,7 @@ store_pwm(struct device *dev, struct
device_attribute *attr,
 	unsigned long val;
 	int err;

-	err = strict_strtoul(buf, 10, &val);
+	err = kstrtoul(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1376,7 +1376,7 @@ store_pwm_enable(struct device *dev, struct
device_attribute *attr,
 	int err;
 	u16 reg;

-	err = strict_strtoul(buf, 10, &val);
+	err = kstrtoul(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1430,7 +1430,7 @@ store_target_temp(struct device *dev, struct
device_attribute *attr,
 	long val;
 	int err;

-	err = strict_strtol(buf, 10, &val);
+	err = kstrtol(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1455,7 +1455,7 @@ store_tolerance(struct device *dev, struct
device_attribute *attr,
 	long val;
 	int err;

-	err = strict_strtol(buf, 10, &val);
+	err = kstrtol(buf, 10, &val);
 	if (err < 0)
 		return err;

@@ -1556,7 +1556,7 @@ store_##reg(struct device *dev, struct
device_attribute *attr, \
 	int nr = sensor_attr->index; \
 	unsigned long val; \
 	int err; \
-	err = strict_strtoul(buf, 10, &val); \
+	err = kstrtoul(buf, 10, &val); \
 	if (err < 0) \
 		return err; \
 	val = SENSORS_LIMIT(val, 1, 255); \
@@ -1595,7 +1595,7 @@ store_##reg(struct device *dev, struct
device_attribute *attr, \
 	int nr = sensor_attr->index; \
 	unsigned long val; \
 	int err; \
-	err = strict_strtoul(buf, 10, &val); \
+	err = kstrtoul(buf, 10, &val); \
 	if (err < 0) \
 		return err; \
 	val = step_time_to_reg(val, data->pwm_mode[nr]); \
@@ -1702,7 +1702,7 @@ clear_caseopen(struct device *dev, struct
device_attribute *attr,
 	unsigned long val;
 	u16 reg, mask;

-	if (strict_strtoul(buf, 10, &val) || val != 0)
+	if (kstrtoul(buf, 10, &val) || val != 0)
 		return -EINVAL;

 	mask = to_sensor_dev_attr_2(attr)->nr;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-14 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-14  1:39 [RFC][PATCH 1/2] hwmon: (w83627ehf) Replace deprecated strict_strto* Alex Rio
2012-01-14 17:25 ` Guenter Roeck
2012-01-14 17:44   ` Jean Delvare
2012-01-14 17:46     ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox