mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
MIPS: Re-use kstrtobool_from_user()
Re-use kstrtobool_from_user() instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Signed-off-by: James Hogan <jhogan@kernel.org>
This commit is contained in:
parent
f06e7aa47f
commit
f83e4e1e0e
@ -31,17 +31,10 @@ static ssize_t sc_prefetch_write(struct file *file,
|
||||
const char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
char buf[32];
|
||||
ssize_t buf_size;
|
||||
bool enabled;
|
||||
int err;
|
||||
|
||||
buf_size = min(count, sizeof(buf) - 1);
|
||||
if (copy_from_user(buf, user_buf, buf_size))
|
||||
return -EFAULT;
|
||||
|
||||
buf[buf_size] = '\0';
|
||||
err = strtobool(buf, &enabled);
|
||||
err = kstrtobool_from_user(user_buf, count, &enabled);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user