* [PATCH] w1: replace strict_strtol() with kstrtol()
@ 2013-07-19 7:16 Jingoo Han
2013-07-22 20:00 ` Evgeniy Polyakov
0 siblings, 1 reply; 4+ messages in thread
From: Jingoo Han @ 2013-07-19 7:16 UTC (permalink / raw)
To: 'Evgeniy Polyakov'; +Cc: linux-kernel, Jingoo Han
The usage of strict_strtol() is not preferred, because
strict_strtol() is obsolete. Thus, kstrtol() should be
used.
Signed-off-by: Jingoo Han <jg1.han@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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] w1: replace strict_strtol() with kstrtol()
2013-07-19 7:16 [PATCH] w1: replace strict_strtol() with kstrtol() Jingoo Han
@ 2013-07-22 20:00 ` Evgeniy Polyakov
2013-07-26 23:16 ` GregKH
0 siblings, 1 reply; 4+ messages in thread
From: Evgeniy Polyakov @ 2013-07-22 20:00 UTC (permalink / raw)
To: Jingoo Han; +Cc: linux-kernel, GregKH
Hi everyone
19.07.2013, 11:16, "Jingoo Han" <jg1.han@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 <zbr@ioremap.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] w1: replace strict_strtol() with kstrtol()
2013-07-22 20:00 ` Evgeniy Polyakov
@ 2013-07-26 23:16 ` GregKH
2013-07-26 23:54 ` Рустафа Джамурахметов
0 siblings, 1 reply; 4+ messages in thread
From: GregKH @ 2013-07-26 23:16 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: Jingoo Han, linux-kernel
On Tue, Jul 23, 2013 at 12:00:44AM +0400, Evgeniy Polyakov wrote:
> Hi everyone
>
> 19.07.2013, 11:16, "Jingoo Han" <jg1.han@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 <zbr@ioremap.net>
Can someone resend this, I don't seem to be able to find it...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] w1: replace strict_strtol() with kstrtol()
2013-07-26 23:16 ` GregKH
@ 2013-07-26 23:54 ` Рустафа Джамурахметов
0 siblings, 0 replies; 4+ messages in thread
From: Рустафа Джамурахметов @ 2013-07-26 23:54 UTC (permalink / raw)
To: GregKH; +Cc: Jingoo Han, linux-kernel
27.07.2013, 03:16, "GregKH" <greg@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.han@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 <zbr@ioremap.net>
>
> Can someone resend this, I don't seem to be able to find it...
Looks like Andrew Morton picked it up today
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-26 23:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 7:16 [PATCH] w1: replace strict_strtol() with kstrtol() Jingoo Han
2013-07-22 20:00 ` Evgeniy Polyakov
2013-07-26 23:16 ` GregKH
2013-07-26 23:54 ` Рустафа Джамурахметов
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.