Skip to content

Commit b0c85e9

Browse files
TANSHPYuryNorov
authored andcommitted
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 <[email protected]> Signed-off-by: Yury Norov [NVIDIA] <[email protected]>
1 parent f49a4af commit b0c85e9

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
@@ -558,22 +558,6 @@ unsigned int cpumask_nth_and(unsigned int cpu, const struct cpumask *srcp1,
558558
small_cpumask_bits, cpumask_check(cpu));
559559
}
560560

561-
/**
562-
* cpumask_nth_andnot - get the Nth cpu set in 1st cpumask, and clear in 2nd.
563-
* @srcp1: the cpumask pointer
564-
* @srcp2: the cpumask pointer
565-
* @cpu: the Nth cpu to find, starting from 0
566-
*
567-
* Return: >= nr_cpu_ids if such cpu doesn't exist.
568-
*/
569-
static __always_inline
570-
unsigned int cpumask_nth_andnot(unsigned int cpu, const struct cpumask *srcp1,
571-
const struct cpumask *srcp2)
572-
{
573-
return find_nth_andnot_bit(cpumask_bits(srcp1), cpumask_bits(srcp2),
574-
small_cpumask_bits, cpumask_check(cpu));
575-
}
576-
577561
/**
578562
* cpumask_nth_and_andnot - get the Nth cpu set in 1st and 2nd cpumask, and clear in 3rd.
579563
* @srcp1: the cpumask pointer

include/linux/find.h

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

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

0 commit comments

Comments
 (0)