Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363175 > unrolled thread

[PATCH 0/5] mm: make several functions return bool

Started byYaowei Bai <baiyaowei@cmss.chinamobile.com>
First post2016-03-23 03:30 +0100
Last post2016-03-23 03:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] mm: make several functions return bool Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2016-03-23 03:30 +0100
    [PATCH 3/5] mm/vmalloc: is_vmalloc_addr can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2016-03-23 03:30 +0100

#1363175 — [PATCH 0/5] mm: make several functions return bool

FromYaowei Bai <baiyaowei@cmss.chinamobile.com>
Date2016-03-23 03:30 +0100
Subject[PATCH 0/5] mm: make several functions return bool
Message-ID<rfGIx-54a-7@gated-at.bofh.it>
This series only makes several functions return bool to
improve readability, no other functional changes.

Yaowei Bai (5):
  mm/hugetlb: is_vm_hugetlb_page can be boolean
  mm/memory_hotplug: is_mem_section_removable can be boolean
  mm/vmalloc: is_vmalloc_addr can be boolean
  mm/lru: is_file/active_lru can be boolean
  mm/mempolicy: vma_migratable can be boolean

 include/linux/hugetlb_inline.h |  6 +++---
 include/linux/memory_hotplug.h |  6 +++---
 include/linux/mempolicy.h      | 10 +++++-----
 include/linux/mm.h             |  4 ++--
 include/linux/mmzone.h         |  4 ++--
 mm/memory_hotplug.c            |  6 +++---
 6 files changed, 18 insertions(+), 18 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1363176 — [PATCH 3/5] mm/vmalloc: is_vmalloc_addr can be boolean

FromYaowei Bai <baiyaowei@cmss.chinamobile.com>
Date2016-03-23 03:30 +0100
Subject[PATCH 3/5] mm/vmalloc: is_vmalloc_addr can be boolean
Message-ID<rfGIy-54a-29@gated-at.bofh.it>
In reply to#1363175
This patch makes is_vmalloc_addr return bool to improve
readability due to this particular function only using either
one or zero as its return value.

No functional change.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 include/linux/mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index dbf1edd..826d2fb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -400,14 +400,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
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web