Commit 13070833 authored by Yuan ZhaoXiong's avatar Yuan ZhaoXiong Committed by Thomas Gleixner

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: default avatarYuan ZhaoXiong <yuanzhaoxiong@baidu.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Link: https://lore.kernel.org/r/1621776690-13264-1-git-send-email-yuanzhaoxiong@baidu.com
parent c4681547
...@@ -961,7 +961,7 @@ static int takedown_cpu(unsigned int cpu) ...@@ -961,7 +961,7 @@ static int takedown_cpu(unsigned int cpu)
int err; int err;
/* Park the smpboot threads */ /* Park the smpboot threads */
kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread); kthread_park(st->thread);
/* /*
* Prevent irq alloc/free while the dying cpu reorganizes the * Prevent irq alloc/free while the dying cpu reorganizes the
...@@ -977,7 +977,7 @@ static int takedown_cpu(unsigned int cpu) ...@@ -977,7 +977,7 @@ static int takedown_cpu(unsigned int cpu)
/* CPU refused to die */ /* CPU refused to die */
irq_unlock_sparse(); irq_unlock_sparse();
/* Unpark the hotplug thread so we can rollback there */ /* Unpark the hotplug thread so we can rollback there */
kthread_unpark(per_cpu_ptr(&cpuhp_state, cpu)->thread); kthread_unpark(st->thread);
return err; return err;
} }
BUG_ON(cpu_online(cpu)); BUG_ON(cpu_online(cpu));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment