aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cpumask.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-23 11:43:40 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-23 11:43:40 -0700
commit91de76e661a266731fc2889a398ad1694df9d523 (patch)
treeecc278f000f18e5b2b880f61ee4b0e68ebd1d6d4 /lib/cpumask.c
parentInput: edt-ft5x06 - implement support for the EDT-M12 series (diff)
parentLinux 4.14-rc6 (diff)
downloadlinux-dev-91de76e661a266731fc2889a398ad1694df9d523.tar.xz
linux-dev-91de76e661a266731fc2889a398ad1694df9d523.zip
Merge tag 'v4.14-rc6' into next
Merge with mainline to bring in the timer API changes.
Diffstat (limited to 'lib/cpumask.c')
-rw-r--r--lib/cpumask.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c
index 4731a0895760..8b1a1bd77539 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -6,6 +6,22 @@
#include <linux/bootmem.h>
/**
+ * cpumask_next - get the next cpu in a cpumask
+ * @n: the cpu prior to the place to search (ie. return will be > @n)
+ * @srcp: the cpumask pointer
+ *
+ * Returns >= nr_cpu_ids if no further cpus set.
+ */
+unsigned int cpumask_next(int n, const struct cpumask *srcp)
+{
+ /* -1 is a legal arg here. */
+ if (n != -1)
+ cpumask_check(n);
+ return find_next_bit(cpumask_bits(srcp), nr_cpumask_bits, n + 1);
+}
+EXPORT_SYMBOL(cpumask_next);
+
+/**
* cpumask_next_and - get the next cpu in *src1p & *src2p
* @n: the cpu prior to the place to search (ie. return will be > @n)
* @src1p: the first cpumask pointer