Received: by 10.223.185.116 with SMTP id b49csp7200104wrg; Thu, 1 Mar 2018 01:19:22 -0800 (PST) X-Google-Smtp-Source: AG47ELul9px0AVsBWSczTZ3ETVv+bJqx28el690hkjywySu+CoSU3l7efAOszq7t4KojKedHOGV6 X-Received: by 10.99.116.10 with SMTP id p10mr992341pgc.97.1519895962143; Thu, 01 Mar 2018 01:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519895962; cv=none; d=google.com; s=arc-20160816; b=lQpiw3EQDPYCdheMtIUR/50R4WSWteItq42fEQfuHyyKX0dY49WzqhBuGH+1ST82rF 0dgIzF7bOxo7KOezeJKAu0/hBgdGozU3q9TTNGpH8a32UCfDSNB1s9n4FrsYOXTBF+6r Q2Je4kd9xUasZ8B89MbLzwTE1XOy4hdhxg5n9Ki0981rsGQYcifnvcF+TkasEgjtdY1Q ThHeU56qd1qTpLdUB3N5ndUx6kWrY/PQC60bNZYXIi3cipp+TArLrOJkXTOEZHVCSs2d jCS+XJ4OQDZnbOHG5VYOv/vyiGKA7NlUno2L9wZuKLSJlzKKL7HPRNY7KsXIYnHVtr49 BOTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=GKZyCzaeQYHxgpqmhGEcOG1A4js2e7ZVviRD6vASgIc=; b=bnPkY+fcwm8JI6iHGELsILr+pjq2ojIGJr30f2fK12QcqiuynP4L7EYGpYFWLW4XrC SvivvI+OQhXU1zbKZfTVluFZHFk44W2jwab2W5hFDQv3G+QxC31843FFNQs6cWkdn+R6 V8mfYjDxqc6ffezhsslPHeOsNynO6xJWD/C8e/WE+Kiz0neCdLl76ZYAf+pT7Qs0bdxc dxLJGVnMPMrU0LIN+QLGUqVxvxxV9haHJOgONzFwAC1/x7sEU6ewbMg7bhlKXOI1p1ho PDCAKXx6LX8VVvOz8NDHK+Po0272JwlSWJB1EdjFdp7cMHBjBwN87IOiKGRFtpN+3dPN Ix6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si2769445pld.591.2018.03.01.01.19.07; Thu, 01 Mar 2018 01:19:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966862AbeCAJRj (ORCPT + 99 others); Thu, 1 Mar 2018 04:17:39 -0500 Received: from terminus.zytor.com ([198.137.202.136]:42475 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966683AbeCAJRh (ORCPT ); Thu, 1 Mar 2018 04:17:37 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w219HTa4009351; Thu, 1 Mar 2018 01:17:29 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w219HS3R009348; Thu, 1 Mar 2018 01:17:28 -0800 Date: Thu, 1 Mar 2018 01:17:28 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, douly.fnst@cn.fujitsu.com, linux-kernel@vger.kernel.org Reply-To: douly.fnst@cn.fujitsu.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <20180301055930.2396-4-douly.fnst@cn.fujitsu.com> References: <20180301055930.2396-4-douly.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Drop logical_smp_processor_id() inline Git-Commit-ID: 8f1561680f42a5491b371b513f1ab8197f31fd62 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8f1561680f42a5491b371b513f1ab8197f31fd62 Gitweb: https://git.kernel.org/tip/8f1561680f42a5491b371b513f1ab8197f31fd62 Author: Dou Liyang AuthorDate: Thu, 1 Mar 2018 13:59:30 +0800 Committer: Thomas Gleixner CommitDate: Thu, 1 Mar 2018 10:12:21 +0100 x86/apic: Drop logical_smp_processor_id() inline The logical_smp_processor_id() inline which is only called in setup_local_APIC() on x86_32 systems has no real value. Drop it and directly use GET_APIC_LOGICAL_ID() at the call site and use a more suitable variable name for readability Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: bhe@redhat.com Cc: ebiederm@xmission.com Link: https://lkml.kernel.org/r/20180301055930.2396-4-douly.fnst@cn.fujitsu.com --- arch/x86/include/asm/smp.h | 10 ---------- arch/x86/kernel/apic/apic.c | 10 +++++----- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 461f53d27708..e2057780d67f 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -176,16 +176,6 @@ static inline int wbinvd_on_all_cpus(void) extern unsigned disabled_cpus; #ifdef CONFIG_X86_LOCAL_APIC - -#ifndef CONFIG_X86_64 -static inline int logical_smp_processor_id(void) -{ - /* we don't want to mark this access volatile - bad code generation */ - return GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); -} - -#endif - extern int hard_smp_processor_id(void); #else /* CONFIG_X86_LOCAL_APIC */ diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 7a347d7450b6..ce2066373922 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1468,7 +1468,7 @@ static void setup_local_APIC(void) int cpu = smp_processor_id(); unsigned int value; #ifdef CONFIG_X86_32 - int i; + int logical_apicid, ldr_apicid; #endif @@ -1507,11 +1507,11 @@ static void setup_local_APIC(void) * initialized during get_smp_config(), make sure it matches the * actual value. */ - i = early_per_cpu(x86_cpu_to_logical_apicid, cpu); - WARN_ON(i != BAD_APICID && i != logical_smp_processor_id()); + logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); + ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); + WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid); /* always use the value from LDR */ - early_per_cpu(x86_cpu_to_logical_apicid, cpu) = - logical_smp_processor_id(); + early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid; #endif /*