diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-12-14 20:58:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:12 -0500 |
commit | ee32398fda8ab9867cf8d5469d6e83de5f5c1f7c (patch) | |
tree | e9eb30bef01bea2f33d012d0faa8ca293c6113df | |
parent | 80ad89a0ceb3b16d0f670751ef9875c4569fb4d3 (diff) |
/dev/mem: remove redundant parameter from do_write_kmem()
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/char/mem.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 868ff2ce1675..be832b6f8279 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -461,7 +461,7 @@ static ssize_t read_kmem(struct file *file, char __user *buf, | |||
461 | 461 | ||
462 | 462 | ||
463 | static inline ssize_t | 463 | static inline ssize_t |
464 | do_write_kmem(void *p, unsigned long realp, const char __user * buf, | 464 | do_write_kmem(unsigned long p, const char __user *buf, |
465 | size_t count, loff_t *ppos) | 465 | size_t count, loff_t *ppos) |
466 | { | 466 | { |
467 | ssize_t written, sz; | 467 | ssize_t written, sz; |
@@ -470,12 +470,11 @@ do_write_kmem(void *p, unsigned long realp, const char __user * buf, | |||
470 | written = 0; | 470 | written = 0; |
471 | #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED | 471 | #ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED |
472 | /* we don't have page 0 mapped on sparc and m68k.. */ | 472 | /* we don't have page 0 mapped on sparc and m68k.. */ |
473 | if (realp < PAGE_SIZE) { | 473 | if (p < PAGE_SIZE) { |
474 | sz = size_inside_page(realp, count); | 474 | sz = size_inside_page(p, count); |
475 | /* Hmm. Do something? */ | 475 | /* Hmm. Do something? */ |
476 | buf += sz; | 476 | buf += sz; |
477 | p += sz; | 477 | p += sz; |
478 | realp += sz; | ||
479 | count -= sz; | 478 | count -= sz; |
480 | written += sz; | 479 | written += sz; |
481 | } | 480 | } |
@@ -484,14 +483,14 @@ do_write_kmem(void *p, unsigned long realp, const char __user * buf, | |||
484 | while (count > 0) { | 483 | while (count > 0) { |
485 | char *ptr; | 484 | char *ptr; |
486 | 485 | ||
487 | sz = size_inside_page(realp, count); | 486 | sz = size_inside_page(p, count); |
488 | 487 | ||
489 | /* | 488 | /* |
490 | * On ia64 if a page has been mapped somewhere as | 489 | * On ia64 if a page has been mapped somewhere as |
491 | * uncached, then it must also be accessed uncached | 490 | * uncached, then it must also be accessed uncached |
492 | * by the kernel or data corruption may occur | 491 | * by the kernel or data corruption may occur |
493 | */ | 492 | */ |
494 | ptr = xlate_dev_kmem_ptr(p); | 493 | ptr = xlate_dev_kmem_ptr((char *)p); |
495 | 494 | ||
496 | copied = copy_from_user(ptr, buf, sz); | 495 | copied = copy_from_user(ptr, buf, sz); |
497 | if (copied) { | 496 | if (copied) { |
@@ -502,7 +501,6 @@ do_write_kmem(void *p, unsigned long realp, const char __user * buf, | |||
502 | } | 501 | } |
503 | buf += sz; | 502 | buf += sz; |
504 | p += sz; | 503 | p += sz; |
505 | realp += sz; | ||
506 | count -= sz; | 504 | count -= sz; |
507 | written += sz; | 505 | written += sz; |
508 | } | 506 | } |
@@ -526,7 +524,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf, | |||
526 | if (p < (unsigned long) high_memory) { | 524 | if (p < (unsigned long) high_memory) { |
527 | unsigned long to_write = min_t(unsigned long, count, | 525 | unsigned long to_write = min_t(unsigned long, count, |
528 | (unsigned long)high_memory - p); | 526 | (unsigned long)high_memory - p); |
529 | wrote = do_write_kmem((void *)p, p, buf, to_write, ppos); | 527 | wrote = do_write_kmem(p, buf, to_write, ppos); |
530 | if (wrote != to_write) | 528 | if (wrote != to_write) |
531 | return wrote; | 529 | return wrote; |
532 | p += wrote; | 530 | p += wrote; |