Skip to content

Commit

Permalink
mm/vmalloc.c: is_vmalloc_addr() can return bool
Browse files Browse the repository at this point in the history
Make is_vmalloc_addr() return bool to improve readability due to this
particular function only using either one or zero as its return value.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Yaowei Bai authored and Linus Torvalds committed May 20, 2016
1 parent c98940f commit bb00a78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,14 @@ unsigned long vmalloc_to_pfn(const void *addr);
* On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there
* is no special casing required.
*/
static inline int is_vmalloc_addr(const void *x)
static inline bool is_vmalloc_addr(const void *x)
{
#ifdef CONFIG_MMU
unsigned long addr = (unsigned long)x;

return addr >= VMALLOC_START && addr < VMALLOC_END;
#else
return 0;
return false;
#endif
}
#ifdef CONFIG_MMU
Expand Down

0 comments on commit bb00a78

Please sign in to comment.