Skip to contentSkip to conversation

mm/vmalloc.c: is_vmalloc_addr() can return bool

PATCH New [email protected] 1 participant 1 message May 20, 2016 MM core

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 51/117 mm/vmalloc.c: is_vmalloc_addr() can return bool

From: Yaowei Bai <[email protected]>
Subject: mm/vmalloc.c: is_vmalloc_addr() can return bool

Make is_vmalloc_addr() return bool to improve readability due to this particular function only using either one or zero as its return value.

---

 include/linux/mm.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-vmalloc-is_vmalloc_addr-can-be-boolean +2 -2
diff -puN include/linux/mm.h~mm-vmalloc-is_vmalloc_addr-can-be-boolean include/linux/mm.h
@@ -447,14 +447,14 @@ unsigned long vmalloc_to_pfn(const void
  * 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

_