Skip to content

Commit

Permalink
uml: use simple_write_to_buffer()
Browse files Browse the repository at this point in the history
Simplify write file operation for mmapper by using
simple_write_to_buffer().

Signed-off-by: Akinobu Mita <[email protected]>
Cc: Jeff Dike <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and torvalds committed Jan 13, 2011
1 parent 07ecb79 commit 0388fae
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/um/drivers/mmapper_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0388fae

Please sign in to comment.