From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932484AbcAMMky (ORCPT ); Wed, 13 Jan 2016 07:40:54 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:41382 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932343AbcAMMkv (ORCPT ); Wed, 13 Jan 2016 07:40:51 -0500 Date: Wed, 13 Jan 2016 15:39:40 +0300 From: Dan Carpenter To: Thomas Gleixner , Yinghai Lu Cc: Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Borislav Petkov , Aravind Gopalakrishnan , Andy Lutomirski , Huang Rui , Hector Marco-Gisbert , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] x86/AMD: remove an unneeded condition in srat_detect_node() Message-ID: <20160113123940.GE19993@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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))