From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/2] powerpc/smp: Drop superfluous NULL check
Date: Fri, 13 Mar 2020 20:16:50 +0530 [thread overview]
Message-ID: <20200313144650.GD25144@linux.vnet.ibm.com> (raw)
In-Reply-To: <20200313112020.28235-1-mpe@ellerman.id.au>
* Michael Ellerman <mpe@ellerman.id.au> [2020-03-13 22:20:19]:
> 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).
>
Looks good to me.
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> 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.21.1
>
--
Thanks and Regards
Srikar Dronamraju
next prev parent reply other threads:[~2020-03-13 14:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 11:20 [PATCH 1/2] powerpc/smp: Drop superfluous NULL check Michael Ellerman
2020-03-13 11:20 ` [PATCH 2/2] powerpc/smp: Use IS_ENABLED() to avoid #ifdef Michael Ellerman
2020-03-13 14:54 ` Srikar Dronamraju
2020-03-13 14:46 ` Srikar Dronamraju [this message]
2020-04-01 12:53 ` [PATCH 1/2] powerpc/smp: Drop superfluous NULL check Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313144650.GD25144@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.