Thread (1 message) 1 message, 1 author, 2011-11-10

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

From: JJ Ding <hidden>
Date: 2011-11-10 08:07:37
Also in: lkml

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 [off-list ref] wrote:
Hello ,
Some doubts .

On Wed, Nov 9, 2011 at 2:05 PM, JJ Ding [off-list ref] wrote:
quoted
@@ -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 ?
quoted
       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 ?

quoted
       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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help