Skip to content

Commit 1307083

Browse files
Yuan ZhaoXiongKAGA-KOKO
authored andcommitted
cpu/hotplug: Simplify access to percpu cpuhp_state
It is unnecessary to invoke per_cpu_ptr() everytime to access cpuhp_state. Use the available pointer instead. Signed-off-by: Yuan ZhaoXiong <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Valentin Schneider <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c468154 commit 1307083

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static int takedown_cpu(unsigned int cpu)
961961
int err;
962962

963963
/* Park the smpboot threads */
964-
kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread);
964+
kthread_park(st->thread);
965965

966966
/*
967967
* Prevent irq alloc/free while the dying cpu reorganizes the
@@ -977,7 +977,7 @@ static int takedown_cpu(unsigned int cpu)
977977
/* CPU refused to die */
978978
irq_unlock_sparse();
979979
/* Unpark the hotplug thread so we can rollback there */
980-
kthread_unpark(per_cpu_ptr(&cpuhp_state, cpu)->thread);
980+
kthread_unpark(st->thread);
981981
return err;
982982
}
983983
BUG_ON(cpu_online(cpu));

0 commit comments

Comments
 (0)