Commit c72e8da0 authored by Michael Ellerman's avatar Michael Ellerman

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200313112020.28235-2-mpe@ellerman.id.au
parent 4b4d181d
...@@ -1189,18 +1189,17 @@ int get_physical_package_id(int cpu) ...@@ -1189,18 +1189,17 @@ int get_physical_package_id(int cpu)
{ {
int pkg_id = cpu_to_chip_id(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 * 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 * defined. Hence we would return the chip-id as the result of
* get_physical_package_id. * 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); struct device_node *np = of_get_cpu_node(cpu, NULL);
pkg_id = of_node_to_nid(np); pkg_id = of_node_to_nid(np);
of_node_put(np); of_node_put(np);
} }
#endif /* CONFIG_PPC_SPLPAR */
return pkg_id; return pkg_id;
} }
......
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