]> Git Repo - linux.git/commitdiff
x86/cpu/amd: Remove an unneeded condition in srat_detect_node()
authorDan Carpenter <[email protected]>
Wed, 13 Jan 2016 12:39:40 +0000 (15:39 +0300)
committerIngo Molnar <[email protected]>
Thu, 14 Jan 2016 08:46:00 +0000 (09:46 +0100)
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 <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Aravind Gopalakrishnan <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Hector Marco-Gisbert <[email protected]>
Cc: Huang Rui <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Yinghai Lu <[email protected]>
Link: http://lkml.kernel.org/r/20160113123940.GE19993@mwanda
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/cpu/amd.c

index e678ddeed03067c3e1d63ebc3b7bd53239d3f8cb..a07956a08936e8ea56c1a73075d700d281895577 100644 (file)
@@ -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))
This page took 0.072839 seconds and 4 git commands to generate.