From: Thomas Gleixner Date: Tue, 29 May 2018 15:49:05 +0000 (+0200) Subject: cpu/hotplug: Split do_cpu_down() X-Git-Tag: v4.17.15~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77db3823f0a5b6a9e3addb2e796dd9f08c14b02d;p=thirdparty%2Fkernel%2Fstable.git cpu/hotplug: Split do_cpu_down() commit cc1fe215e1efa406b03aa4389e6269b61342dec5 upstream Split out the inner workings of do_cpu_down() to allow reuse of that function for the upcoming SMT disabling mechanism. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/cpu.c b/kernel/cpu.c index 7e811e2c32d28..90ca45b45e3a4 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -906,20 +906,19 @@ out: return ret; } +static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target) +{ + if (cpu_hotplug_disabled) + return -EBUSY; + return _cpu_down(cpu, 0, target); +} + static int do_cpu_down(unsigned int cpu, enum cpuhp_state target) { int err; cpu_maps_update_begin(); - - if (cpu_hotplug_disabled) { - err = -EBUSY; - goto out; - } - - err = _cpu_down(cpu, 0, target); - -out: + err = cpu_down_maps_locked(cpu, target); cpu_maps_update_done(); return err; }