From 4b4d181d63518334070a877ba789211bde77da9e Mon Sep 17 00:00:00 2001
From: Michael Ellerman <mpe@ellerman.id.au>
Date: Fri, 13 Mar 2020 22:20:19 +1100
Subject: [PATCH] powerpc/smp: Drop superfluous NULL check
References: jsc#SLE-13615 bsc#1180100 ltc#190257
Patch-mainline: v5.7-rc1
Git-commit: 4b4d181d63518334070a877ba789211bde77da9e
We don't need the NULL check of np, the result is the same because the
OF helpers cope with NULL, of_node_to_nid(NULL) == NUMA_NO_NODE (-1).
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-1-mpe@ellerman.id.au
Acked-by: Michal Suchanek <msuchanek@suse.de>
---
arch/powerpc/kernel/smp.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 37c12e3bab9e..aae61a3b3201 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1197,11 +1197,8 @@ int get_physical_package_id(int cpu)
*/
if (pkg_id == -1 && firmware_has_feature(FW_FEATURE_LPAR)) {
struct device_node *np = of_get_cpu_node(cpu, NULL);
-
- if (np) {
- pkg_id = of_node_to_nid(np);
- of_node_put(np);
- }
+ pkg_id = of_node_to_nid(np);
+ of_node_put(np);
}
#endif /* CONFIG_PPC_SPLPAR */
--
2.26.2