Commit 3cd92217 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 5ad4f1c7
...@@ -131,7 +131,6 @@ static ssize_t read_mem(struct file * file, char __user * buf, ...@@ -131,7 +131,6 @@ static ssize_t read_mem(struct file * file, char __user * buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
unsigned long p = *ppos; unsigned long p = *ppos;
unsigned long ret;
ssize_t read, sz; ssize_t read, sz;
char *ptr; char *ptr;
...@@ -156,6 +155,9 @@ static ssize_t read_mem(struct file * file, char __user * buf, ...@@ -156,6 +155,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
#endif #endif
while (count > 0) { while (count > 0) {
unsigned long remaining;
int ret;
sz = size_inside_page(p, count); sz = size_inside_page(p, count);
if (!range_is_allowed(p >> PAGE_SHIFT, count)) if (!range_is_allowed(p >> PAGE_SHIFT, count))
...@@ -170,9 +172,9 @@ static ssize_t read_mem(struct file * file, char __user * buf, ...@@ -170,9 +172,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
if (!ptr) if (!ptr)
return -EFAULT; return -EFAULT;
ret = copy_to_user(buf, ptr, sz); remaining = copy_to_user(buf, ptr, sz);
unxlate_dev_mem_ptr(p, ptr); unxlate_dev_mem_ptr(p, ptr);
if (ret) if (remaining)
return -EFAULT; return -EFAULT;
buf += sz; 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