aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/smp.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2020-03-13 22:20:20 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2020-03-27 01:15:09 +1100
commitc72e8da06250390bb7759399a32fa0ab6f84e6d1 (patch)
tree042b6cb001465efe2d9be331312aa03317db2a32 /arch/powerpc/kernel/smp.c
parent4b4d181d63518334070a877ba789211bde77da9e (diff)
downloadlinux-c72e8da06250390bb7759399a32fa0ab6f84e6d1.tar.gz
powerpc/smp: Use IS_ENABLED() to avoid #ifdef
We can avoid the #ifdef by using IS_ENABLED() in the existing condition check. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200313112020.28235-2-mpe@ellerman.id.au
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r--arch/powerpc/kernel/smp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index aae61a3b320149..6d2a3a3666f09f 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1189,18 +1189,17 @@ int get_physical_package_id(int cpu)
{
int pkg_id = cpu_to_chip_id(cpu);
-#ifdef CONFIG_PPC_SPLPAR
/*
* If the platform is PowerNV or Guest on KVM, ibm,chip-id is
* defined. Hence we would return the chip-id as the result of
* get_physical_package_id.
*/
- if (pkg_id == -1 && firmware_has_feature(FW_FEATURE_LPAR)) {
+ if (pkg_id == -1 && firmware_has_feature(FW_FEATURE_LPAR) &&
+ IS_ENABLED(CONFIG_PPC_SPLPAR)) {
struct device_node *np = of_get_cpu_node(cpu, NULL);
pkg_id = of_node_to_nid(np);
of_node_put(np);
}
-#endif /* CONFIG_PPC_SPLPAR */
return pkg_id;
}