From b6dad11d9cb105681abbfc3d57aae4b21bd0c8c4 Mon Sep 17 00:00:00 2001 From: Yury Norov Date: Sun, 23 Jan 2022 10:38:45 -0800 Subject: arch/ia64: replace cpumask_weight with cpumask_empty where appropriate 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 --- arch/ia64/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/ia64') 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 */ -- cgit v1.2.3 From a570e68fabec2f209d94abaabca8aab419437dab Mon Sep 17 00:00:00 2001 From: Yury Norov Date: Fri, 6 May 2022 21:08:10 -0700 Subject: ia64: cleanup remove_siblinginfo() remove_siblinginfo() initialises variable 'last', but never uses it. Drop unneeded code. CC: Ingo Molnar CC: Peter Zijlstra CC: Valentin Schneider CC: linux-ia64@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov Acked-by: Andrew Morton --- arch/ia64/kernel/smpboot.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch/ia64') diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index d10f780c13b9..d0e935cf2093 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c @@ -576,8 +576,6 @@ clear_cpu_sibling_map(int cpu) static void remove_siblinginfo(int cpu) { - int last = 0; - if (cpu_data(cpu)->threads_per_core == 1 && cpu_data(cpu)->cores_per_socket == 1) { cpumask_clear_cpu(cpu, &cpu_core_map[cpu]); @@ -585,8 +583,6 @@ remove_siblinginfo(int cpu) return; } - last = (cpumask_weight(&cpu_core_map[cpu]) == 1 ? 1 : 0); - /* remove it from all sibling map's */ clear_cpu_sibling_map(cpu); } -- cgit v1.2.3