mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
uml: use simple_write_to_buffer()
Simplify write file operation for mmapper by using simple_write_to_buffer(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
07ecb79f51
commit
0388fae411
1 changed files with 1 additions and 7 deletions
|
@ -37,13 +37,7 @@ static ssize_t mmapper_write(struct file *file, const char __user *buf,
|
||||||
if (*ppos > mmapper_size)
|
if (*ppos > mmapper_size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (count > mmapper_size - *ppos)
|
return simple_write_to_buffer(v_buf, mmapper_size, ppos, buf, count);
|
||||||
count = mmapper_size - *ppos;
|
|
||||||
|
|
||||||
if (copy_from_user(&v_buf[*ppos], buf, count))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
|
Loading…
Reference in a new issue