From: Akinobu Mita Date: Thu, 13 Jan 2011 00:59:28 +0000 (-0800) Subject: uml: use simple_write_to_buffer() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0388fae4115dcfc310ac7327a8ac72786987c26e;p=openwrt%2Fstaging%2Fblogic.git uml: use simple_write_to_buffer() Simplify write file operation for mmapper by using simple_write_to_buffer(). Signed-off-by: Akinobu Mita Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index 6bc73f0e8e29..7e0619c2c2c6 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)