]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/smp: Drop superfluous NULL check
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 13 Mar 2020 11:20:19 +0000 (22:20 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 26 Mar 2020 14:15:09 +0000 (01:15 +1100)
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
arch/powerpc/kernel/smp.c

index 37c12e3bab9edbc1d8c65b27763a5d606ae0ba4a..aae61a3b320149a050688014d907a730be494e11 100644 (file)
@@ -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 */