Skip to content

Commit 036999d

Browse files
hkamezawaRussell King
authored andcommitted
[ARM] for_each_possible_cpu
for_each_cpu() actually iterates across all possible CPUs. We've had mistakes in the past where people were using for_each_cpu() where they should have been iterating across only online or present CPUs. This is inefficient and possibly buggy. We're renaming for_each_cpu() to for_each_possible_cpu() to avoid this in the future. This patch replaces for_each_cpu with for_each_possible_cpu. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 1c97b73 commit 036999d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/arm/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ static int __init topology_init(void)
807807
{
808808
int cpu;
809809

810-
for_each_cpu(cpu)
810+
for_each_possible_cpu(cpu)
811811
register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL);
812812

813813
return 0;

0 commit comments

Comments
 (0)