Skip to contentSkip to conversation

w1: replace strict_strtol() with kstrtol()

PATCH In review Jingoo Han 3 participants 4 messages Jul 19, 2013 – Jul 26, 2013 W1 dallas's 1-wire bus

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 w1: replace strict_strtol() with kstrtol()

The usage of strict_strtol() is not preferred, because strict_strtol() is obsolete. Thus, kstrtol() should be used.

---
 drivers/w1/w1.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/w1/w1.c +8 -4
index 0459df8..46a8fd7 100644
@@ -235,9 +235,11 @@ static ssize_t w1_master_attribute_store_search(struct device * dev,
 {
 	long tmp;
 	struct w1_master *md = dev_to_w1_master(dev);
+	int ret;
 
-	if (strict_strtol(buf, 0, &tmp) == -EINVAL)
-		return -EINVAL;
+	ret = kstrtol(buf, 0, &tmp);
+	if (ret)
+		return ret;
 
 	mutex_lock(&md->mutex);
 	md->search_count = tmp;
@@ -267,9 +269,11 @@ static ssize_t w1_master_attribute_store_pullup(struct device *dev,
 {
 	long tmp;
 	struct w1_master *md = dev_to_w1_master(dev);
+	int ret;
 
-	if (strict_strtol(buf, 0, &tmp) == -EINVAL)
-		return -EINVAL;
+	ret = kstrtol(buf, 0, &tmp);
+	if (ret)
+		return ret;
 
 	mutex_lock(&md->mutex);
 	md->enable_pullup = tmp;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw

Hi everyone

19.07.2013, 11:16, "Jingoo Han" <[email protected]>:

Quoted 3 lines

The usage of strict_strtol() is not preferred, because strict_strtol() is obsolete. Thus, kstrtol() should be used.

Looks good to me, although I do not really see the difference Greg, please pull into your tree or suggest appropriate.

#2 lore raw
Quoted 11 lines · Evgeniy Polyakov

Hi everyone

19.07.2013, 11:16, "Jingoo Han" <[email protected]>:

Quoted 3 lines

The usage of strict_strtol() is not preferred, because strict_strtol() is obsolete. Thus, kstrtol() should be used.

Looks good to me, although I do not really see the difference Greg, please pull into your tree or suggest appropriate.

Can someone resend this, I don't seem to be able to find it...

thanks,

greg k-h

#3 lore raw

27.07.2013, 03:16, "GregKH" <[email protected]>:

Quoted 8 lines · Evgeniy Polyakov
Quoted 7 lines

 Hi everyone

 19.07.2013, 11:16, "Jingoo Han" <[email protected]>:

Quoted 3 lines

 The usage of strict_strtol() is not preferred, because strict_strtol() is obsolete. Thus, kstrtol() should be used.

Quoted 6 lines
Quoted 4 lines

 Looks good to me, although I do not really see the difference Greg, please pull into your tree or suggest appropriate.

Can someone resend this, I don't seem to be able to find it...

Looks like Andrew Morton picked it up today