summaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2011-03-24 00:42:58 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-24 03:46:40 +0100
commitcfaf346cb2741ca648d83527df173b759381e607 (patch)
tree578b3d6ce766950fb20f29839c6fbae5aad41a36 /drivers/char/mem.c
parentdrivers/staging/tty/specialix.c: convert func_enter to func_exit (diff)
downloadlinux-cfaf346cb2741ca648d83527df173b759381e607.tar.xz
linux-cfaf346cb2741ca648d83527df173b759381e607.zip
drivers/char/mem.c: clean up the code
Reduce the lines of code and simplify the logic. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 1256454b2d43..436a99017998 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -47,10 +47,7 @@ static inline unsigned long size_inside_page(unsigned long start,
#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
static inline int valid_phys_addr_range(unsigned long addr, size_t count)
{
- if (addr + count > __pa(high_memory))
- return 0;
-
- return 1;
+ return addr + count <= __pa(high_memory);
}
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)