Commit 4f50dc9d authored by Andrew Morton's avatar Andrew Morton Committed by james toy

cleanuplets.

Cc: Andi Kleen <ak@linux.intel.com>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 87e141aa
......@@ -131,7 +131,6 @@ static ssize_t read_mem(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
{
unsigned long p = *ppos;
unsigned long ret;
ssize_t read, sz;
char *ptr;
......@@ -156,6 +155,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
#endif
while (count > 0) {
unsigned long remaining;
int ret;
sz = size_inside_page(p, count);
if (!range_is_allowed(p >> PAGE_SHIFT, count))
......@@ -170,9 +172,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
if (!ptr)
return -EFAULT;
ret = copy_to_user(buf, ptr, sz);
remaining = copy_to_user(buf, ptr, sz);
unxlate_dev_mem_ptr(p, ptr);
if (ret)
if (remaining)
return -EFAULT;
buf += sz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment