Skip to content

Commit 7e97c0f

Browse files
committed
cpumask: Remove unnecessary cpumask_nth_andnot()
JIRA: https://issues.redhat.com/browse/RHEL-122044 commit b0c85e9 Author: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Date: Mon Jun 23 16:46:45 2025 +0900 cpumask: Remove unnecessary cpumask_nth_andnot() Commit 94f7531("x86/resctrl: Optimize cpumask_any_housekeeping()") switched the only user of cpumask_nth_andnot() to other cpumask functions, but left the function cpumask_nth_andnot() unused. This makes function find_nth_andnot_bit() unused as well. Delete them. Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 0f5b66c commit 7e97c0f

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

include/linux/cpumask.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -529,22 +529,6 @@ unsigned int cpumask_nth_and(unsigned int cpu, const struct cpumask *srcp1,
529529
small_cpumask_bits, cpumask_check(cpu));
530530
}
531531

532-
/**
533-
* cpumask_nth_andnot - get the Nth cpu set in 1st cpumask, and clear in 2nd.
534-
* @srcp1: the cpumask pointer
535-
* @srcp2: the cpumask pointer
536-
* @cpu: the Nth cpu to find, starting from 0
537-
*
538-
* Return: >= nr_cpu_ids if such cpu doesn't exist.
539-
*/
540-
static __always_inline
541-
unsigned int cpumask_nth_andnot(unsigned int cpu, const struct cpumask *srcp1,
542-
const struct cpumask *srcp2)
543-
{
544-
return find_nth_andnot_bit(cpumask_bits(srcp1), cpumask_bits(srcp2),
545-
small_cpumask_bits, cpumask_check(cpu));
546-
}
547-
548532
/**
549533
* cpumask_nth_and_andnot - get the Nth cpu set in 1st and 2nd cpumask, and clear in 3rd.
550534
* @srcp1: the cpumask pointer

include/linux/find.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -267,33 +267,6 @@ unsigned long find_nth_and_bit(const unsigned long *addr1, const unsigned long *
267267
return __find_nth_and_bit(addr1, addr2, size, n);
268268
}
269269

270-
/**
271-
* find_nth_andnot_bit - find N'th set bit in 2 memory regions,
272-
* flipping bits in 2nd region
273-
* @addr1: The 1st address to start the search at
274-
* @addr2: The 2nd address to start the search at
275-
* @size: The maximum number of bits to search
276-
* @n: The number of set bit, which position is needed, counting from 0
277-
*
278-
* Returns the bit number of the N'th set bit.
279-
* If no such, returns @size.
280-
*/
281-
static __always_inline
282-
unsigned long find_nth_andnot_bit(const unsigned long *addr1, const unsigned long *addr2,
283-
unsigned long size, unsigned long n)
284-
{
285-
if (n >= size)
286-
return size;
287-
288-
if (small_const_nbits(size)) {
289-
unsigned long val = *addr1 & (~*addr2) & GENMASK(size - 1, 0);
290-
291-
return val ? fns(val, n) : size;
292-
}
293-
294-
return __find_nth_andnot_bit(addr1, addr2, size, n);
295-
}
296-
297270
/**
298271
* find_nth_and_andnot_bit - find N'th set bit in 2 memory regions,
299272
* excluding those set in 3rd region

0 commit comments

Comments
 (0)