]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2547e71161cf366995886678ca875e3f9f66c2b7
treed789e4a7958fcde2c25d55d7e436452f461bcc8f
parent6dcab2a7bb77608df7f76c0e89db0ebc010a4707
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