Skip to contentSkip to conversation

mem: clean up the code

PATCH New Changli Gao 1 participant 1 message Feb 21, 2011 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mem: clean up the code

Reduce the lines of code and simply the logic.

---
 drivers/char/mem.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/char/mem.c +1 -4
index 1256454..436a990 100644
@@ -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)