From: tip-bot for Dan Carpenter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: Aravind.Gopalakrishnan@amd.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, ray.huang@amd.com, dan.carpenter@oracle.com,
torvalds@linux-foundation.org, hecmargi@upv.es, hpa@zytor.com,
mingo@kernel.org, yhlu.kernel@gmail.com, bp@suse.de,
luto@kernel.org, peterz@infradead.org
Subject: [tip:x86/urgent] x86/cpu/amd: Remove an unneeded condition in srat_detect_node()
Date: Thu, 14 Jan 2016 01:07:23 -0800 [thread overview]
Message-ID: <tip-7030a7e9321166eef44c811fe4af4d460360d424@git.kernel.org> (raw)
In-Reply-To: <20160113123940.GE19993@mwanda>
Commit-ID: 7030a7e9321166eef44c811fe4af4d460360d424
Gitweb: http://git.kernel.org/tip/7030a7e9321166eef44c811fe4af4d460360d424
Author: Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Wed, 13 Jan 2016 15:39:40 +0300
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jan 2016 09:46:00 +0100
x86/cpu/amd: Remove an unneeded condition in srat_detect_node()
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>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Hector Marco-Gisbert <hecmargi@upv.es>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Link: http://lkml.kernel.org/r/20160113123940.GE19993@mwanda
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/amd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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))
prev parent reply other threads:[~2016-01-14 9:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 12:39 [patch] x86/AMD: remove an unneeded condition in srat_detect_node() Dan Carpenter
2016-01-14 5:48 ` Huang Rui
2016-01-14 9:07 ` tip-bot for Dan Carpenter [this message]
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=tip-7030a7e9321166eef44c811fe4af4d460360d424@git.kernel.org \
--to=tipbot@zytor.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=bp@suse.de \
--cc=dan.carpenter@oracle.com \
--cc=hecmargi@upv.es \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=ray.huang@amd.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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