diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-01-13 07:39:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-01-14 03:46:00 -0500 |
commit | 7030a7e9321166eef44c811fe4af4d460360d424 (patch) | |
tree | 3a8a74d673062205cd7dc396fc9d7f173aed6bc7 | |
parent | 78fd8c7288e0a4bba3ad1d69caf9396a6b69cb00 (diff) |
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>
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index e678ddeed030..a07956a08936 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) | |||
434 | */ | 434 | */ |
435 | int ht_nodeid = c->initial_apicid; | 435 | int ht_nodeid = c->initial_apicid; |
436 | 436 | ||
437 | if (ht_nodeid >= 0 && | 437 | if (__apicid_to_node[ht_nodeid] != NUMA_NO_NODE) |
438 | __apicid_to_node[ht_nodeid] != NUMA_NO_NODE) | ||
439 | node = __apicid_to_node[ht_nodeid]; | 438 | node = __apicid_to_node[ht_nodeid]; |
440 | /* Pick a nearby node */ | 439 | /* Pick a nearby node */ |
441 | if (!node_online(node)) | 440 | if (!node_online(node)) |