OSDN Git Service

mm/vmalloc.c: is_vmalloc_addr() can return bool
authorYaowei Bai <baiyaowei@cmss.chinamobile.com>
Fri, 20 May 2016 00:11:29 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 May 2016 02:12:14 +0000 (19:12 -0700)
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>
include/linux/mm.h

index 1193a54..5b37513 100644 (file)
@@ -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