Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752995AbdCMUeQ (ORCPT ); Mon, 13 Mar 2017 16:34:16 -0400 Received: from terminus.zytor.com ([65.50.211.136]:48856 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404AbdCMUeJ (ORCPT ); Mon, 13 Mar 2017 16:34:09 -0400 Date: Mon, 13 Mar 2017 13:33:54 -0700 From: tip-bot for Dou Liyang Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, douly.fnst@cn.fujitsu.com Reply-To: tglx@linutronix.de, linux-kernel@vger.kernel.org, douly.fnst@cn.fujitsu.com, hpa@zytor.com, mingo@kernel.org In-Reply-To: <1488971270-14359-1-git-send-email-douly.fnst@cn.fujitsu.com> References: <1488971270-14359-1-git-send-email-douly.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Remove the SET_APIC_ID(x) macro Git-Commit-ID: 5d64d209c4f672e221ea304106b30793f10d95a4 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 Content-Length: 2168 Lines: 60 Commit-ID: 5d64d209c4f672e221ea304106b30793f10d95a4 Gitweb: http://git.kernel.org/tip/5d64d209c4f672e221ea304106b30793f10d95a4 Author: Dou Liyang AuthorDate: Wed, 8 Mar 2017 19:07:50 +0800 Committer: Thomas Gleixner CommitDate: Mon, 13 Mar 2017 21:28:38 +0100 x86/apic: Remove the SET_APIC_ID(x) macro The SET_APIC_ID() macro obfusates the code. Remove it to increase readability and add a comment to the apic struct to document that the callback is required on 64-bit. Signed-off-by: Dou Liyang Link: http://lkml.kernel.org/r/1488971270-14359-1-git-send-email-douly.fnst@cn.fujitsu.com Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/apic.h | 7 +------ arch/x86/kernel/apic/apic.c | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 730ef65..bdffcd9 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -252,12 +252,6 @@ static inline int x2apic_enabled(void) { return 0; } #define x2apic_supported() (0) #endif /* !CONFIG_X86_X2APIC */ -#ifdef CONFIG_X86_64 -#define SET_APIC_ID(x) (apic->set_apic_id(x)) -#else - -#endif - /* * Copyright 2004 James Cleverdon, IBM. * Subject to the GNU Public License, v.2 @@ -299,6 +293,7 @@ struct apic { int (*phys_pkg_id)(int cpuid_apic, int index_msb); unsigned int (*get_apic_id)(unsigned long x); + /* Can't be NULL on 64-bit */ unsigned long (*set_apic_id)(unsigned int id); int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index aee7ded..f3034ba 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2249,7 +2249,7 @@ void __init apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v)) static void __init apic_bsp_up_setup(void) { #ifdef CONFIG_X86_64 - apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid)); + apic_write(APIC_ID, apic->set_apic_id(boot_cpu_physical_apicid)); #else /* * Hack: In case of kdump, after a crash, kernel might be booting