linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: JJ Ding <jj_ding@emc.com.tw>
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: Mon, 7 Nov 2011 22:28:01 -0800	[thread overview]
Message-ID: <20111108062800.GA1837@core.coreip.homeip.net> (raw)
In-Reply-To: <20111108035930.GC21927@core.coreip.homeip.net>

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.

-- 
Dmitry

  reply	other threads:[~2011-11-08  6:28 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 [this message]
2011-11-08  7:47     ` JJ Ding
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=20111108062800.GA1837@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=dgdunix@gmail.com \
    --cc=jj_ding@emc.com.tw \
    --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;
as well as URLs for NNTP newsgroup(s).