diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-01-12 16:59:28 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 08:03:07 -0800 |
commit | 0388fae4115dcfc310ac7327a8ac72786987c26e (patch) | |
tree | 87af4fc66ff911d996d5bbc1b49ad84ddedc5210 /arch | |
parent | 07ecb79f513fc126c56642caaf9efeeefaceffaa (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/mmapper_kern.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index 6bc73f0e8e2..7e0619c2c2c 100644 --- a/arch/um/drivers/mmapper_kern.c +++ b/arch/um/drivers/mmapper_kern.c @@ -37,13 +37,7 @@ static ssize_t mmapper_write(struct file *file, const char __user *buf, if (*ppos > mmapper_size) return -EINVAL; - if (count > mmapper_size - *ppos) - count = mmapper_size - *ppos; - - if (copy_from_user(&v_buf[*ppos], buf, count)) - return -EFAULT; - - return count; + return simple_write_to_buffer(v_buf, mmapper_size, ppos, buf, count); } static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |