From: David Howells <dhowells@redhat.com>
To: linux-arch@vger.kernel.org
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 05/13] Make nodemask functions that return a boolean value return bool
Date: Wed, 29 Apr 2015 20:22:03 +0100 [thread overview]
Message-ID: <20150429192203.24909.84448.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20150429192133.24909.43184.stgit@warthog.procyon.org.uk>
Make nodemask functions that return a boolean value return bool as this allows
gcc to make better choices.
Signed-off-by: David Howells <dhowells@redhat.com>
---
include/linux/nodemask.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 6e85889cf9ab..520dcb59f53d 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -141,7 +141,7 @@ static inline void __nodes_clear(nodemask_t *dstp, unsigned int nbits)
#define node_test_and_set(node, nodemask) \
__node_test_and_set((node), &(nodemask))
-static inline int __node_test_and_set(int node, nodemask_t *addr)
+static inline bool __node_test_and_set(int node, nodemask_t *addr)
{
return test_and_set_bit(node, addr->bits);
}
@@ -188,7 +188,7 @@ static inline void __nodes_complement(nodemask_t *dstp,
#define nodes_equal(src1, src2) \
__nodes_equal(&(src1), &(src2), MAX_NUMNODES)
-static inline int __nodes_equal(const nodemask_t *src1p,
+static inline bool __nodes_equal(const nodemask_t *src1p,
const nodemask_t *src2p, unsigned int nbits)
{
return bitmap_equal(src1p->bits, src2p->bits, nbits);
@@ -196,7 +196,7 @@ static inline int __nodes_equal(const nodemask_t *src1p,
#define nodes_intersects(src1, src2) \
__nodes_intersects(&(src1), &(src2), MAX_NUMNODES)
-static inline int __nodes_intersects(const nodemask_t *src1p,
+static inline bool __nodes_intersects(const nodemask_t *src1p,
const nodemask_t *src2p, unsigned int nbits)
{
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
@@ -204,20 +204,20 @@ static inline int __nodes_intersects(const nodemask_t *src1p,
#define nodes_subset(src1, src2) \
__nodes_subset(&(src1), &(src2), MAX_NUMNODES)
-static inline int __nodes_subset(const nodemask_t *src1p,
+static inline bool __nodes_subset(const nodemask_t *src1p,
const nodemask_t *src2p, unsigned int nbits)
{
return bitmap_subset(src1p->bits, src2p->bits, nbits);
}
#define nodes_empty(src) __nodes_empty(&(src), MAX_NUMNODES)
-static inline int __nodes_empty(const nodemask_t *srcp, unsigned int nbits)
+static inline bool __nodes_empty(const nodemask_t *srcp, unsigned int nbits)
{
return bitmap_empty(srcp->bits, nbits);
}
#define nodes_full(nodemask) __nodes_full(&(nodemask), MAX_NUMNODES)
-static inline int __nodes_full(const nodemask_t *srcp, unsigned int nbits)
+static inline bool __nodes_full(const nodemask_t *srcp, unsigned int nbits)
{
return bitmap_full(srcp->bits, nbits);
}
@@ -395,7 +395,7 @@ enum node_states {
extern nodemask_t node_states[NR_NODE_STATES];
#if MAX_NUMNODES > 1
-static inline int node_state(int node, enum node_states state)
+static inline bool node_state(int node, enum node_states state)
{
return node_isset(node, node_states[state]);
}
@@ -446,7 +446,7 @@ static inline void node_set_offline(int nid)
#else
-static inline int node_state(int node, enum node_states state)
+static inline bool node_state(int node, enum node_states state)
{
return node == 0;
}
next prev parent reply other threads:[~2015-04-29 19:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 19:21 [RFC][PATCH 00/13] Convert bitop funcs to bool return type and propagate to various callers/users David Howells
2015-04-29 19:21 ` David Howells
2015-04-29 19:21 ` [PATCH 01/13] Make the x86 bitops like test_bit() return bool David Howells
2015-04-29 19:21 ` David Howells
2015-12-17 20:38 ` Dan Williams
2015-04-29 19:21 ` [PATCH 02/13] Make bitmap functions that return boolean values return a bool type David Howells
2015-04-29 19:21 ` David Howells
2015-04-29 19:21 ` [PATCH 03/13] Make generic bitops return bool David Howells
2015-04-29 19:21 ` David Howells
2015-04-29 19:21 ` [PATCH 04/13] Make cpumask functions that return boolean values " David Howells
2015-04-29 19:22 ` David Howells [this message]
2015-04-29 19:22 ` [PATCH 05/13] Make nodemask functions that return a boolean value " David Howells
2015-04-29 19:22 ` [PATCH 06/13] Make a bunch of mm funcs return bool when they're returning a boolean value David Howells
2015-04-29 19:22 ` David Howells
2015-04-29 19:22 ` [PATCH 07/13] Make some apic functions return bool when " David Howells
2015-04-29 19:22 ` [PATCH 08/13] Make tick functions that return a boolean value return bool David Howells
2015-04-29 19:22 ` [PATCH 09/13] input: Use bool and don't use !! on test_bit David Howells
2015-04-29 19:22 ` David Howells
2015-04-29 19:22 ` [PATCH 10/13] Use bool with jbd2_journal_cancel_revoke() David Howells
2015-04-29 19:22 ` David Howells
2015-04-29 19:22 ` [PATCH 11/13] test_taint() should return bool David Howells
2015-04-29 19:22 ` David Howells
2015-04-29 19:22 ` [PATCH 12/13] netlink: Use bool when returning boolean values David Howells
2015-04-29 19:22 ` David Howells
2015-04-29 19:22 ` [PATCH 13/13] Make xfrm functions that return a boolean value return bool David Howells
2015-04-29 19:22 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150429192203.24909.84448.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox