提交 0388fae4 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

uml: use simple_write_to_buffer()

Simplify write file operation for mmapper by using
simple_write_to_buffer().
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 07ecb79f
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册