[PATCH 15/49] arch/ia64: replace cpumask_weight with cpumask_empty where appropriate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Yury Norov <yury.norov@xxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Michał Mirosław <mirq-linux@xxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, David Laight <David.Laight@xxxxxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>, Dennis Zhou <dennis@xxxxxxxxxx>, Emil Renner Berthing <kernel@xxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>, Alexey Klimov <aklimov@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Geert Uytterhoeven <geert+renesas@xxxxxxxxx>, Yang Guang <yang.guang5@xxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx
- Subject: [PATCH 15/49] arch/ia64: replace cpumask_weight with cpumask_empty where appropriate
- From: Yury Norov <yury.norov@xxxxxxxxx>
- Date: Thu, 10 Feb 2022 14:48:59 -0800
- In-reply-to: <20220210224933.379149-1-yury.norov@gmail.com>
- References: <20220210224933.379149-1-yury.norov@gmail.com>
setup_arch() calls cpumask_weight() to check if any bit of a given cpumask
is set. We can do it more efficiently with cpumask_empty() because
cpumask_empty() stops traversing the cpumask as soon as it finds first set
bit, while cpumask_weight() counts all bits unconditionally.
Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
---
arch/ia64/kernel/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5010348fa21b..fd6301eafa9d 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -572,7 +572,7 @@ setup_arch (char **cmdline_p)
#ifdef CONFIG_ACPI_HOTPLUG_CPU
prefill_possible_map();
#endif
- per_cpu_scan_finalize((cpumask_weight(&early_cpu_possible_map) == 0 ?
+ per_cpu_scan_finalize((cpumask_empty(&early_cpu_possible_map) ?
32 : cpumask_weight(&early_cpu_possible_map)),
additional_cpus > 0 ? additional_cpus : 0);
#endif /* CONFIG_ACPI_NUMA */
--
2.32.0
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]