提交 cfaf346c 编写于 作者: C Changli Gao 提交者: Linus Torvalds

drivers/char/mem.c: clean up the code

Reduce the lines of code and simplify the logic.
Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 115bcd15
...@@ -47,10 +47,7 @@ static inline unsigned long size_inside_page(unsigned long start, ...@@ -47,10 +47,7 @@ static inline unsigned long size_inside_page(unsigned long start,
#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE #ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
static inline int valid_phys_addr_range(unsigned long addr, size_t count) static inline int valid_phys_addr_range(unsigned long addr, size_t count)
{ {
if (addr + count > __pa(high_memory)) return addr + count <= __pa(high_memory);
return 0;
return 1;
} }
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册