The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Andy Shevchenko'" <andy.shevchenko@gmail.com>
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	"'Alessandro Zummo'" <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com, Jingoo Han <jg1.han@samsung.com>
Subject: Re: [PATCH] rtc: rtc-pcf2123: replace strict_strtoul() with kstrtoul()
Date: Mon, 03 Jun 2013 16:05:37 +0900	[thread overview]
Message-ID: <000101ce6028$c01fa220$405ee660$@samsung.com> (raw)
In-Reply-To: <CAHp75Vce+=1Fdb0Eqg0w+e511cAJeZ8cP6-d+9ng=s-5tJ5C+g@mail.gmail.com>

On Sunday, June 02, 2013 8:56 PM, Andy Shevchenko wrote:
> On Sat, Jun 1, 2013 at 10:31 AM, Jingoo Han <jg1.han@samsung.com> wrote:
> > The usage of strict_strtoul() is not preferred, because
> > strict_strtoul() is obsolete. Thus, kstrtoul() should be
> > used.
> 
> > --- a/drivers/rtc/rtc-pcf2123.c
> > +++ b/drivers/rtc/rtc-pcf2123.c
> > @@ -94,7 +94,7 @@ static ssize_t pcf2123_show(struct device *dev, struct device_attribute *attr,
> >
> >         r = container_of(attr, struct pcf2123_sysfs_reg, attr);
> >
> > -       if (strict_strtoul(r->name, 16, &reg))
> > +       if (kstrtoul(r->name, 16, &reg))
> >                 return -EINVAL;
> 
> ret = kstrtoul(...);
> if (ret)
> return ret;
> 
> > @@ -117,8 +117,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
> >
> >         r = container_of(attr, struct pcf2123_sysfs_reg, attr);
> >
> > -       if (strict_strtoul(r->name, 16, &reg)
> > -               || strict_strtoul(buffer, 10, &val))
> > +       if (kstrtoul(r->name, 16, &reg) || kstrtoul(buffer, 10, &val))
> >                 return -EINVAL;
> 
> I see no harm to allow user to write octal values as well.
> Thus, just
> ret = kstrtoul(r->name, 0, &reg);

If you want to do this, please send another patch later, on top of this patch.
I just want to address the replacing strict_strtoul() with kstrtoul().

Best regards,
Jingoo Han

> if (ret)
> return ret;
> 
> Alessandro, what do you think?
> 
> --
> With Best Regards,
> Andy Shevchenko


      reply	other threads:[~2013-06-03  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01  7:31 [PATCH] rtc: rtc-pcf2123: replace strict_strtoul() with kstrtoul() Jingoo Han
2013-06-02 11:56 ` Andy Shevchenko
2013-06-03  7:05   ` Jingoo Han [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000101ce6028$c01fa220$405ee660$@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox