[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260114172217.861204-2-ynorov@nvidia.com>
Date: Wed, 14 Jan 2026 12:22:13 -0500
From: Yury Norov <ynorov@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Alistair Popple <apopple@...dia.com>,
Byungchul Park <byungchul@...com>,
David Hildenbrand <david@...nel.org>,
Gregory Price <gourry@...rry.net>,
Johannes Weiner <hannes@...xchg.org>,
Joshua Hahn <joshua.hahnjy@...il.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Matthew Brost <matthew.brost@...el.com>,
Michal Hocko <mhocko@...e.com>,
Michal Koutný <mkoutny@...e.com>,
Mike Rapoport <rppt@...nel.org>,
Rakie Kim <rakie.kim@...com>,
Suren Baghdasaryan <surenb@...gle.com>,
Tejun Heo <tj@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>,
Waiman Long <longman@...hat.com>,
Ying Huang <ying.huang@...ux.alibaba.com>,
Zi Yan <ziy@...dia.com>,
cgroups@...r.kernel.org
Cc: Yury Norov <ynorov@...dia.com>,
Yury Norov <yury.norov@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] nodemask: propagate boolean for nodes_and{,not}
Bitmap functions bitmap_and{,not} return boolean depending on emptiness
of the result bitmap. The corresponding nodemask helpers ignore the
returned value.
Propagate the underlying bitmaps result to nodemasks users, as it
simplifies user code.
Signed-off-by: Yury Norov <ynorov@...dia.com>
---
include/linux/nodemask.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index bd38648c998d..204c92462f3c 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -157,10 +157,10 @@ static __always_inline bool __node_test_and_set(int node, nodemask_t *addr)
#define nodes_and(dst, src1, src2) \
__nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES)
-static __always_inline void __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
+static __always_inline bool __nodes_and(nodemask_t *dstp, const nodemask_t *src1p,
const nodemask_t *src2p, unsigned int nbits)
{
- bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
+ return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
}
#define nodes_or(dst, src1, src2) \
@@ -181,10 +181,10 @@ static __always_inline void __nodes_xor(nodemask_t *dstp, const nodemask_t *src1
#define nodes_andnot(dst, src1, src2) \
__nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES)
-static __always_inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
+static __always_inline bool __nodes_andnot(nodemask_t *dstp, const nodemask_t *src1p,
const nodemask_t *src2p, unsigned int nbits)
{
- bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
+ return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}
#define nodes_copy(dst, src) __nodes_copy(&(dst), &(src), MAX_NUMNODES)
--
2.43.0
Powered by blists - more mailing lists