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


Groups > linux.kernel > #1269870

[PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool

From Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Newsgroups linux.kernel
Subject [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool
Date 2015-11-16 08:00 +0100
Message-ID <qvlVF-3Sn-23@gated-at.bofh.it> (permalink)
References <qvlVD-3Sn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch makes gfp_zonelist return bool due to this
particular function only using either one or zero as its return
value.

This patch also makes gfp_zonelist return directly by removing if.

No functional change.

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

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 6523109..1da03f5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -375,12 +375,9 @@ static inline enum zone_type gfp_zone(gfp_t flags)
  * virtual kernel addresses to the allocated page(s).
  */
 
-static inline int gfp_zonelist(gfp_t flags)
+static inline bool gfp_zonelist(gfp_t flags)
 {
-	if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
-		return 1;
-
-	return 0;
+	return IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE);
 }
 
 /*
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] some small improvement Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-16 08:00 +0100
  [PATCH 4/7] mm/vmscan: page_is_file_cache can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-16 08:00 +0100
    Re: [PATCH 4/7] mm/vmscan: page_is_file_cache can be boolean David Rientjes <rientjes@google.com> - 2015-11-16 11:20 +0100
      Re: [PATCH 4/7] mm/vmscan: page_is_file_cache can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 03:20 +0100
  [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-16 08:00 +0100
    Re: [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool David Rientjes <rientjes@google.com> - 2015-11-16 11:10 +0100
      Re: [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 03:10 +0100
        Re: [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool David Rientjes <rientjes@google.com> - 2015-11-17 06:50 +0100
          Re: [PATCH 6/7] mm/gfp: make gfp_zonelist return directly and bool Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 09:40 +0100
  [PATCH] mm/zonelist: enumerate zonelists array index Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 10:10 +0100
  [PATCH] mm/mmzone: memmap_valid_within can be boolean Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-18 02:40 +0100

csiph-web