staging: lustre: ldlm: ldlm_resource.c replace obsolete function with kstrtoul()
authorAnil Belur <askb23@gmail.com>
Thu, 19 Jun 2014 15:02:08 +0000 (01:02 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jun 2014 00:22:24 +0000 (17:22 -0700)
- this change fixes the warning "WARNING: simple_strtoul is obsolete, use
kstrtoul instead"
- removed the unused var 'end' as this is no longer required for
  kstrtoul()

Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c

index e5171da18cfa046cb6303ed51f87a10b675d8e29..25ce0e5f9892a9682f5c4a9ad30cff80b672a9ea 100644 (file)
@@ -194,9 +194,10 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
                                      size_t count, loff_t *off)
 {
        struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
-       char dummy[MAX_STRING_SIZE + 1], *end;
+       char dummy[MAX_STRING_SIZE + 1];
        unsigned long tmp;
        int lru_resize;
+       int err;
 
        dummy[MAX_STRING_SIZE] = '\0';
        if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
@@ -228,8 +229,8 @@ static ssize_t lprocfs_lru_size_seq_write(struct file *file, const char *buffer,
                return count;
        }
 
-       tmp = simple_strtoul(dummy, &end, 0);
-       if (dummy == end) {
+       err = kstrtoul(dummy, 10, &tmp);
+       if (err != 0) {
                CERROR("invalid value written\n");
                return -EINVAL;
        }