[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-7030a7e9321166eef44c811fe4af4d460360d424@git.kernel.org>
Date: Thu, 14 Jan 2016 01:07:23 -0800
From: tip-bot for Dan Carpenter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: Aravind.Gopalakrishnan@....com, linux-kernel@...r.kernel.org,
tglx@...utronix.de, ray.huang@....com, dan.carpenter@...cle.com,
torvalds@...ux-foundation.org, hecmargi@....es, hpa@...or.com,
mingo@...nel.org, yhlu.kernel@...il.com, bp@...e.de,
luto@...nel.org, peterz@...radead.org
Subject: [tip:x86/urgent] x86/cpu/amd:
Remove an unneeded condition in srat_detect_node()
Commit-ID: 7030a7e9321166eef44c811fe4af4d460360d424
Gitweb: http://git.kernel.org/tip/7030a7e9321166eef44c811fe4af4d460360d424
Author: Dan Carpenter <dan.carpenter@...cle.com>
AuthorDate: Wed, 13 Jan 2016 15:39:40 +0300
Committer: Ingo Molnar <mingo@...nel.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@...cle.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Hector Marco-Gisbert <hecmargi@....es>
Cc: Huang Rui <ray.huang@....com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Yinghai Lu <yhlu.kernel@...il.com>
Link: http://lkml.kernel.org/r/20160113123940.GE19993@mwanda
Signed-off-by: Ingo Molnar <mingo@...nel.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))
Powered by blists - more mailing lists