Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] w1: replace strict_strtol() with kstrtol()

46 views
Skip to first unread message

Jingoo Han

unread,
Jul 19, 2013, 3:20:01 AM7/19/13
to
The usage of strict_strtol() is not preferred, because
strict_strtol() is obsolete. Thus, kstrtol() should be
used.

Signed-off-by: Jingoo Han <jg1...@samsung.com>
---
drivers/w1/w1.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 0459df8..46a8fd7 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -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;
--
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Evgeniy Polyakov

unread,
Jul 22, 2013, 4:20:01 PM7/22/13
to
Hi everyone

19.07.2013, 11:16, "Jingoo Han" <jg1...@samsung.com>:
> 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.

Acked-by: Evgeniy Polyakov <z...@ioremap.net>

GregKH

unread,
Jul 26, 2013, 7:20:02 PM7/26/13
to
On Tue, Jul 23, 2013 at 12:00:44AM +0400, Evgeniy Polyakov wrote:
> Hi everyone
>
> 19.07.2013, 11:16, "Jingoo Han" <jg1...@samsung.com>:
> > 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.
>
> Acked-by: Evgeniy Polyakov <z...@ioremap.net>

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

thanks,

greg k-h

Рустафа Джамурахметов

unread,
Jul 26, 2013, 8:00:02 PM7/26/13
to


27.07.2013, 03:16, "GregKH" <gr...@kroah.com>:
> On Tue, Jul 23, 2013 at 12:00:44AM +0400, Evgeniy Polyakov wrote:
>
>> О©╫Hi everyone
>>
>> О©╫19.07.2013, 11:16, "Jingoo Han" <jg1...@samsung.com>:
>>> О©╫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.
>>
>> О©╫Acked-by: Evgeniy Polyakov <z...@ioremap.net>
>
> Can someone resend this, I don't seem to be able to find it...

Looks like Andrew Morton picked it up today
0 new messages