staging: speakup: Note that simple_strtoul can't simply be replaced by kstrtoul
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 23 Feb 2019 19:42:19 +0000 (20:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2019 10:50:17 +0000 (11:50 +0100)
We often receive patches which erroneously try to use kstrtoul in these
places.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/kobjects.c
drivers/staging/speakup/main.c
drivers/staging/speakup/varhandlers.c

index 2e36d872662cef3002256c6113e8a3077aa87699..11c704b27c3c0fb67beb42a337080308c88dae89 100644 (file)
@@ -154,6 +154,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
                        continue;
                }
 
+               /* Do not replace with kstrtoul: here we need temp to be updated */
                index = simple_strtoul(cp, &temp, 10);
                if (index > 255) {
                        rejected++;
@@ -787,6 +788,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
                        continue;
                }
 
+               /* Do not replace with kstrtoul: here we need temp to be updated */
                index = simple_strtoul(cp, &temp, 10);
 
                while ((temp < linefeed) && (*temp == ' ' || *temp == '\t'))
index 869f40ebf1a7079dc6f0be3ce25f2ffa46b50df9..c092a8ea45e28dd9a321ba88ebe4d83d66c4941a 100644 (file)
@@ -1979,6 +1979,7 @@ oops:
                return 1;
        }
 
+       /* Do not replace with kstrtoul: here we need cp to be updated */
        goto_pos = simple_strtoul(goto_buf, &cp, 10);
 
        if (*cp == 'x') {
index 1b545152cc494992fd704c6018a09157dd413e11..3c944cb8f547371dc0c16312103d18f7694669bd 100644 (file)
@@ -328,6 +328,7 @@ char *spk_s2uchar(char *start, char *dest)
 {
        int val;
 
+       /* Do not replace with kstrtoul: here we need start to be updated */
        val = simple_strtoul(skip_spaces(start), &start, 10);
        if (*start == ',')
                start++;