powerpc/sysfs: Move #ifdef CONFIG_HOTPLUG_CPU out of the function body
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 24 Apr 2017 10:46:59 +0000 (20:46 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 May 2017 04:45:38 +0000 (14:45 +1000)
commit3f2290e1b5192fdfa74f012220a8d90067beb076
treed789e4a7958fcde2c25d55d7e436452f461bcc8f
parent687b8f24f14db842c8c3f8cb8b24c9a29b691db8
powerpc/sysfs: Move #ifdef CONFIG_HOTPLUG_CPU out of the function body

The entire body of unregister_cpu_online() is inside an #ifdef
CONFIG_HOTPLUG_CPU block. This is ugly and means we create an empty function
when hotplug is disabled for no reason.

Instead move the #ifdef out of the function body and define the function to be
NULL in the else case. This means we'll pass NULL to cpuhp_setup_state(), but
that's fine because it accepts NULL to mean there is no teardown callback, which
is exactly what we want.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/sysfs.c