diff options
| author | Dawei Li <[email protected]> | 2024-04-16 08:54:48 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2024-04-24 19:23:49 +0000 |
| commit | cdc66553c4130735f0a2db943a5259e54ff1597a (patch) | |
| tree | ec3ebe0bd50ede88a8dc482b80aacb2412a25e4b /lib/find_bit.c | |
| parent | irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown (diff) | |
| download | kernel-cdc66553c4130735f0a2db943a5259e54ff1597a.tar.gz kernel-cdc66553c4130735f0a2db943a5259e54ff1597a.zip | |
cpumask: Introduce cpumask_first_and_and()
Introduce cpumask_first_and_and() to get intersection between 3 cpumasks,
free of any intermediate cpumask variable. Instead, cpumask_first_and_and()
works in-place with all inputs and produces desired output directly.
Signed-off-by: Dawei Li <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Yury Norov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/find_bit.c')
| -rw-r--r-- | lib/find_bit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/find_bit.c b/lib/find_bit.c index 32f99e9a670e..dacadd904250 100644 --- a/lib/find_bit.c +++ b/lib/find_bit.c @@ -116,6 +116,18 @@ unsigned long _find_first_and_bit(const unsigned long *addr1, EXPORT_SYMBOL(_find_first_and_bit); #endif +/* + * Find the first set bit in three memory regions. + */ +unsigned long _find_first_and_and_bit(const unsigned long *addr1, + const unsigned long *addr2, + const unsigned long *addr3, + unsigned long size) +{ + return FIND_FIRST_BIT(addr1[idx] & addr2[idx] & addr3[idx], /* nop */, size); +} +EXPORT_SYMBOL(_find_first_and_and_bit); + #ifndef find_first_zero_bit /* * Find the first cleared bit in a memory region. |
