Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cpumask: Remove unnecessary cpumask_nth_andnot()

Commit 94f753143028("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>

authored by

Shaopeng Tan and committed by
Yury Norov
b0c85e99 f49a4af3

-43
-16
include/linux/cpumask.h
··· 559 559 } 560 560 561 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 - 577 - /** 578 562 * cpumask_nth_and_andnot - get the Nth cpu set in 1st and 2nd cpumask, and clear in 3rd. 579 563 * @srcp1: the cpumask pointer 580 564 * @srcp2: the cpumask pointer
-27
include/linux/find.h
··· 270 270 } 271 271 272 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 - 299 - /** 300 273 * find_nth_and_andnot_bit - find N'th set bit in 2 memory regions, 301 274 * excluding those set in 3rd region 302 275 * @addr1: The 1st address to start the search at