Skip to content

Commit cfaf346

Browse files
xiaosuotorvalds
authored andcommitted
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>
1 parent 115bcd1 commit cfaf346

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎drivers/char/mem.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ static inline unsigned long size_inside_page(unsigned long start,
4747
#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
4848
static inline int valid_phys_addr_range(unsigned long addr, size_t count)
4949
{
50-
if (addr + count > __pa(high_memory))
51-
return 0;
52-
53-
return 1;
50+
return addr + count <= __pa(high_memory);
5451
}
5552

5653
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)

0 commit comments

Comments
 (0)