* [PATCH] mem: clean up the code
@ 2011-02-21 3:56 Changli Gao
0 siblings, 0 replies; only message in thread
From: Changli Gao @ 2011-02-21 3:56 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Changli Gao
Reduce the lines of code and simply the logic.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
drivers/char/mem.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 1256454..436a990 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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-21 3:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21 3:56 [PATCH] mem: clean up the code Changli Gao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.