diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-06-04 13:15:16 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 12:54:08 -0700 |
commit | f7b41276b6b07f47c5f5212fa244385b0e3aaa30 (patch) | |
tree | a5c48de78a236e836da7d3b26e999224c975cc11 /drivers/misc/sgi-gru | |
parent | 4cd5773a2ae6facdde3f563087a4cc50f00d9530 (diff) | |
download | linux-f7b41276b6b07f47c5f5212fa244385b0e3aaa30.tar.gz linux-f7b41276b6b07f47c5f5212fa244385b0e3aaa30.tar.bz2 linux-f7b41276b6b07f47c5f5212fa244385b0e3aaa30.zip |
misc: replace strict_strtoul() with kstrtoul()
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru')
-rw-r--r-- | drivers/misc/sgi-gru/gruprocfs.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c index 797d7962cc88..4f7635922394 100644 --- a/drivers/misc/sgi-gru/gruprocfs.c +++ b/drivers/misc/sgi-gru/gruprocfs.c @@ -160,15 +160,11 @@ static int options_show(struct seq_file *s, void *p) static ssize_t options_write(struct file *file, const char __user *userbuf, size_t count, loff_t *data) { - char buf[20]; - - if (count >= sizeof(buf)) - return -EINVAL; - if (copy_from_user(buf, userbuf, count)) - return -EFAULT; - buf[count] = '\0'; - if (strict_strtoul(buf, 0, &gru_options)) - return -EINVAL; + int ret; + + ret = kstrtoul_from_user(userbuf, count, 0, &gru_options); + if (ret) + return ret; return count; } |