From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752871AbcANJIc (ORCPT ); Thu, 14 Jan 2016 04:08:32 -0500 Received: from terminus.zytor.com ([198.137.202.10]:40249 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbcANJIX (ORCPT ); Thu, 14 Jan 2016 04:08:23 -0500 Date: Thu, 14 Jan 2016 01:07:23 -0800 From: tip-bot for Dan Carpenter Message-ID: 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 Reply-To: Aravind.Gopalakrishnan@amd.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, ray.huang@amd.com, dan.carpenter@oracle.com, hpa@zytor.com, torvalds@linux-foundation.org, hecmargi@upv.es, mingo@kernel.org, yhlu.kernel@gmail.com, bp@suse.de, luto@kernel.org, peterz@infradead.org In-Reply-To: <20160113123940.GE19993@mwanda> References: <20160113123940.GE19993@mwanda> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/cpu/amd: Remove an unneeded condition in srat_detect_node() Git-Commit-ID: 7030a7e9321166eef44c811fe4af4d460360d424 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7030a7e9321166eef44c811fe4af4d460360d424 Gitweb: http://git.kernel.org/tip/7030a7e9321166eef44c811fe4af4d460360d424 Author: Dan Carpenter AuthorDate: Wed, 13 Jan 2016 15:39:40 +0300 Committer: Ingo Molnar 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 Cc: Andy Lutomirski Cc: Aravind Gopalakrishnan Cc: Borislav Petkov Cc: Hector Marco-Gisbert Cc: Huang Rui Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yinghai Lu Link: http://lkml.kernel.org/r/20160113123940.GE19993@mwanda Signed-off-by: Ingo Molnar --- 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))