]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/nodemask: correctly describe nodemask operation return types
authorJoshua Hahn <joshua.hahnjy@gmail.com>
Fri, 29 May 2026 20:27:54 +0000 (13:27 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 9 Jun 2026 01:21:23 +0000 (18:21 -0700)
Commit 0dfe54071d7c8 ("nodemask: Fix return values to be unsigned")
changed a number of nodemask operations that used to return int to
returning a bool instead.  However, it did not update the comment block
that described these functions, leaving the documentation incorrect.

Fix the comment block to accurately describe the functions.  Also fix a
typo (unsigend --> unsigned), and fix a callsite in mempolicy.c that did
not get updated during the conversion.

No functional changes intended; changes are purely cosmetic.

Link: https://lore.kernel.org/20260529202755.1846800-1-joshua.hahnjy@gmail.com
Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/nodemask.h
mm/mempolicy.c

index 204c92462f3c02a7c2ea5a8a5486b0ca08190a6f..b842aa52554644c79062e4681cb8f0a1995a57a1 100644 (file)
  * void nodes_setall(mask)             set all bits
  * void nodes_clear(mask)              clear all bits
  * int node_isset(node, mask)          true iff bit 'node' set in mask
- * int node_test_and_set(node, mask)   test and set bit 'node' in mask
+ * bool node_test_and_set(node, mask)  test and set bit 'node' in mask
  *
- * void nodes_and(dst, src1, src2)     dst = src1 & src2  [intersection]
+ * bool nodes_and(dst, src1, src2)     dst = src1 & src2  [intersection]
  * void nodes_or(dst, src1, src2)      dst = src1 | src2  [union]
  * void nodes_xor(dst, src1, src2)     dst = src1 ^ src2
- * void nodes_andnot(dst, src1, src2)  dst = src1 & ~src2
+ * bool nodes_andnot(dst, src1, src2)  dst = src1 & ~src2
  * void nodes_complement(dst, src)     dst = ~src
  *
- * int nodes_equal(mask1, mask2)       Does mask1 == mask2?
- * int nodes_intersects(mask1, mask2)  Do mask1 and mask2 intersect?
- * int nodes_subset(mask1, mask2)      Is mask1 a subset of mask2?
- * int nodes_empty(mask)               Is mask empty (no bits sets)?
- * int nodes_full(mask)                        Is mask full (all bits sets)?
+ * bool nodes_equal(mask1, mask2)      Does mask1 == mask2?
+ * bool nodes_intersects(mask1, mask2) Do mask1 and mask2 intersect?
+ * bool nodes_subset(mask1, mask2)     Is mask1 a subset of mask2?
+ * bool nodes_empty(mask)              Is mask empty (no bits sets)?
+ * bool nodes_full(mask)               Is mask full (all bits sets)?
  * int nodes_weight(mask)              Hamming weight - number of set bits
  *
  * unsigned int first_node(mask)       Number lowest set bit, or MAX_NUMNODES
- * unsigend int next_node(node, mask)  Next node past 'node', or MAX_NUMNODES
+ * unsigned int next_node(node, mask)  Next node past 'node', or MAX_NUMNODES
  * unsigned int next_node_in(node, mask) Next node past 'node', or wrap to first,
  *                                     or MAX_NUMNODES
  * unsigned int first_unset_node(mask) First node not set in mask, or
index 4e4421b22b59f71adaa37a76572d4c1d2784dbb8..36699fabd3c2239204b7b842f6e51ac3316fac20 100644 (file)
@@ -2865,7 +2865,7 @@ bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
        case MPOL_PREFERRED:
        case MPOL_PREFERRED_MANY:
        case MPOL_WEIGHTED_INTERLEAVE:
-               return !!nodes_equal(a->nodes, b->nodes);
+               return nodes_equal(a->nodes, b->nodes);
        case MPOL_LOCAL:
                return true;
        default: