From: JJ Ding <jj_ding@emc.com.tw>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
JJ Ding <dgdunix@gmail.com>
Subject: Re: [PATCH v2] Input: convert obsolete strict_strtox to kstrtox
Date: Tue, 08 Nov 2011 15:47:36 +0800 [thread overview]
Message-ID: <87vcqv838n.fsf@emc.com.tw> (raw)
In-Reply-To: <20111108062800.GA1837@core.coreip.homeip.net>
On Mon, 7 Nov 2011 22:28:01 -0800, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Mon, Nov 07, 2011 at 07:59:30PM -0800, Dmitry Torokhov wrote:
> > On Mon, Nov 07, 2011 at 07:54:50PM +0800, JJ Ding wrote:
> > > From: JJ Ding <dgdunix@gmail.com>
> > >
> > > With commit 67d0a0754455f89ef3946946159d8ec9e45ce33a we mark strict_strtox
> > > as obsolete. Convert all remaining such uses in drivers/input/.
> > >
> > > Also change the data type from long to int as Dmitry sugguests, we now have
> > > kstrtouint which suits these uses better.
> > >
> >
> > Applied, thanks JJ.
> >
>
> Sorry, I take it back...
>
> > - if (strict_strtoul(buf, 10, &value) || value > 1)
> > + if (kstrtouint(buf, 10, &value) || value > 1)
> > return -EINVAL;
>
> This mangles error condition from kstrtouint and reporting conditions
> beside -EINVAL was the reason for introducing new API IIRC. The proper
> conversion should be:
>
> err = kstrtouint(buf, 10, &value);
> if (err)
> return err;
>
> if (value > 1)
> return -EINVAL;
>
> Thanks.
>
Thanks, I get it. I'll fix and resend.
jj
> --
> Dmitry
next prev parent reply other threads:[~2011-11-08 7:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 11:54 [PATCH v2] Input: convert obsolete strict_strtox to kstrtox JJ Ding
2011-11-08 3:59 ` Dmitry Torokhov
2011-11-08 6:28 ` Dmitry Torokhov
2011-11-08 7:47 ` JJ Ding [this message]
2011-11-08 8:47 ` JJ Ding
2011-11-08 18:41 ` Dmitry Torokhov
2011-11-08 21:33 ` Jonathan Cameron
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=87vcqv838n.fsf@emc.com.tw \
--to=jj_ding@emc.com.tw \
--cc=dgdunix@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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