mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: JJ Ding <jj_ding@emc.com.tw>
To: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	JJ Ding <dgdunix@gmail.com>
Subject: Re: [PATCH v3] Input: convert obsolete strict_strtox to kstrtox
Date: Thu, 10 Nov 2011 16:05:13 +0800	[thread overview]
Message-ID: <87vcqs7686.fsf@emc.com.tw> (raw)
In-Reply-To: <CAM=Q2csTJeZnjcDCm+hmTn9q4_RhU=-2Mnfu84eeOdVESZmo4w@mail.gmail.com>

Hi Shubhrajyoti,

[Your mail has HTML part so I think it was blocked by Lists]

On Wed, 9 Nov 2011 14:32:12 +0530, Shubhrajyoti Datta <omaplinuxkernel@gmail.com> wrote:
> Hello ,
> Some doubts .
> 
> On Wed, Nov 9, 2011 at 2:05 PM, JJ Ding <jj_ding@emc.com.tw> wrote:
> 
> > @@ -1313,7 +1313,11 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd,
> > const char *buf, size_t coun
> >        if (!atkbd->write)
> >                return -EIO;
> >
> > -       if (strict_strtoul(buf, 10, &value) || value > 1)
> > +       err = kstrtouint(buf, 10, &value);
> > +       if (err)
> > +               return err;
> > +
> > +       if (value > 1)
> >                return -EINVAL;
> >
> 
> Is the intention here to have bool ?
> 
> >
> >        if (atkbd->extra != value) {
> > @@ -1389,11 +1393,15 @@ static ssize_t atkbd_show_scroll(struct atkbd
> > *atkbd, char *buf)
> >  static ssize_t atkbd_set_scroll(struct atkbd *atkbd, const char *buf,
> > size_t count)
> >  {
> >        struct input_dev *old_dev, *new_dev;
> > -       unsigned long value;
> > +       unsigned int value;
> >        int err;
> >        bool old_scroll;
> >
> > -       if (strict_strtoul(buf, 10, &value) || value > 1)
> > +       err = kstrtouint(buf, 10, &value);
> > +       if (err)
> > +               return err;
> > +
> > +       if (value > 1)
> >                return -EINVAL;
> >
> 
> Same here ?
> 
> 
> >
> >        if (atkbd->scroll != value) {
> > @@ -1433,7 +1441,7 @@ static ssize_t atkbd_show_set(struct atkbd *atkbd,
> > char *buf)
> >  static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t
> > count)
> >  {
> >        struct input_dev *old_dev, *new_dev;
> > -       unsigned long value;
> > +       unsigned int value;
> >        int err;
> >        unsigned char old_set;
> >        bool old_extra;
> > @@ -1441,7 +1449,11 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd,
> > const char *buf, size_t count)
> >        if (!atkbd->write)
> >                return -EIO;
> >
> > -       if (strict_strtoul(buf, 10, &value) || (value != 2 && value != 3))
> > +       err = kstrtouint(buf, 10, &value);
> > +       if (err)
> > +               return err;
> > +
> > +       if (value != 2 && value != 3)
> >                return -EINVAL;
> >
> 
> Will u8 be sufficient ?
> 

Dmitry suggested we stick with int. please see:
  https://lkml.org/lkml/2011/11/8/328
for our previous discussions.

Thanks,
jj

      parent reply	other threads:[~2011-11-10  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09  8:35 JJ Ding
     [not found] ` <CAM=Q2csTJeZnjcDCm+hmTn9q4_RhU=-2Mnfu84eeOdVESZmo4w@mail.gmail.com>
2011-11-10  8:05   ` JJ Ding [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=87vcqs7686.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 \
    --cc=omaplinuxkernel@gmail.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

Powered by JetHome