Re: [PATCH v3] Input: convert obsolete strict_strtox to kstrtox

From: JJ Ding
Date: Thu Nov 10 2011 - 03:07:38 EST


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@xxxxxxxxx> wrote:
> Hello ,
> Some doubts .
>
> On Wed, Nov 9, 2011 at 2:05 PM, JJ Ding <jj_ding@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/