Commit 4be7085f authored by Jingoo Han's avatar Jingoo Han Committed by Chris Ball

mmc: mmc_test: replace strict_strtol() with kstrtol_from_user()

The usage of strict_strtol() is not preferred, because
strict_strtol() is obsolete. Thus, kstrtol() should be used.

Also, both kstrtol() and copy_from_user() can be replaced
with kstrtol_from_user() to make the code simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent b3894f26
...@@ -2849,18 +2849,12 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf, ...@@ -2849,18 +2849,12 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf,
struct seq_file *sf = (struct seq_file *)file->private_data; struct seq_file *sf = (struct seq_file *)file->private_data;
struct mmc_card *card = (struct mmc_card *)sf->private; struct mmc_card *card = (struct mmc_card *)sf->private;
struct mmc_test_card *test; struct mmc_test_card *test;
char lbuf[12];
long testcase; long testcase;
int ret;
if (count >= sizeof(lbuf)) ret = kstrtol_from_user(buf, count, 10, &testcase);
return -EINVAL; if (ret)
return ret;
if (copy_from_user(lbuf, buf, count))
return -EFAULT;
lbuf[count] = '\0';
if (strict_strtol(lbuf, 10, &testcase))
return -EINVAL;
test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL); test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
if (!test) if (!test)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment