From: Huang Rui <ray.huang@amd.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Yinghai Lu <yhlu.kernel@gmail.com>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
<x86@kernel.org>, Borislav Petkov <bp@suse.de>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Andy Lutomirski <luto@kernel.org>,
"Hector Marco-Gisbert" <hecmargi@upv.es>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [patch] x86/AMD: remove an unneeded condition in srat_detect_node()
Date: Thu, 14 Jan 2016 13:48:24 +0800 [thread overview]
Message-ID: <20160114054823.GB4638@hr-amur2> (raw)
In-Reply-To: <20160113123940.GE19993@mwanda>
On Wed, Jan 13, 2016 at 03:39:40PM +0300, Dan Carpenter wrote:
> Originally we calculated ht_nodeid as "ht_nodeid = apicid - boot_cpu_id;"
> so presumably it could be negative. But after commit 01aaea1afbcd
> ('x86: introduce initial apicid') we use c->initial_apicid which is an
> unsigned short and thus always >= 0.
>
> It causes a static checker warning to test for impossible conditions so
> let's remove it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
Looks OK for me.
Reviewed-by: Huang Rui <ray.huang@amd.com>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index e678dde..a07956a 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -434,8 +434,7 @@ static void srat_detect_node(struct cpuinfo_x86 *c)
> */
> int ht_nodeid = c->initial_apicid;
>
> - if (ht_nodeid >= 0 &&
> - __apicid_to_node[ht_nodeid] != NUMA_NO_NODE)
> + if (__apicid_to_node[ht_nodeid] != NUMA_NO_NODE)
> node = __apicid_to_node[ht_nodeid];
> /* Pick a nearby node */
> if (!node_online(node))
next prev parent reply other threads:[~2016-01-14 5:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 12:39 Dan Carpenter
2016-01-14 5:48 ` Huang Rui [this message]
2016-01-14 9:07 ` [tip:x86/urgent] x86/cpu/amd: Remove " tip-bot for Dan Carpenter
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=20160114054823.GB4638@hr-amur2 \
--to=ray.huang@amd.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=bp@suse.de \
--cc=dan.carpenter@oracle.com \
--cc=hecmargi@upv.es \
--cc=hpa@zytor.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yhlu.kernel@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®