Skip to content

Commit

Permalink
drivers/char/mem.c: clean up the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Changli Gao authored and Linus Torvalds committed Mar 24, 2011
1 parent 115bcd1 commit cfaf346
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cfaf346

Please sign in to comment.