summaryrefslogtreecommitdiff
path: root/lib/find_bit.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2023-03-16 03:31:02 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-03-19 20:02:04 +0300
commit1470afefc3c42df5d1662f87d079b46651bdc95b (patch)
treef295df464adc0ed2f43645a13ed73633371269f5 /lib/find_bit.c
parent3cfb9290da3d87a5877b03bda96c3d5d3ed9fcb0 (diff)
downloadlinux-1470afefc3c42df5d1662f87d079b46651bdc95b.tar.xz
cpumask: introduce for_each_cpu_or
Equivalent of for_each_cpu_and, except it ORs the two masks together so it iterates all the CPUs present in either mask. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'lib/find_bit.c')
-rw-r--r--lib/find_bit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/find_bit.c b/lib/find_bit.c
index c10920e66788..32f99e9a670e 100644
--- a/lib/find_bit.c
+++ b/lib/find_bit.c
@@ -182,6 +182,15 @@ unsigned long _find_next_andnot_bit(const unsigned long *addr1, const unsigned l
EXPORT_SYMBOL(_find_next_andnot_bit);
#endif
+#ifndef find_next_or_bit
+unsigned long _find_next_or_bit(const unsigned long *addr1, const unsigned long *addr2,
+ unsigned long nbits, unsigned long start)
+{
+ return FIND_NEXT_BIT(addr1[idx] | addr2[idx], /* nop */, nbits, start);
+}
+EXPORT_SYMBOL(_find_next_or_bit);
+#endif
+
#ifndef find_next_zero_bit
unsigned long _find_next_zero_bit(const unsigned long *addr, unsigned long nbits,
unsigned long start)