Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830AbdIGItq (ORCPT ); Thu, 7 Sep 2017 04:49:46 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:28595 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754068AbdIGIto (ORCPT ); Thu, 7 Sep 2017 04:49:44 -0400 X-IronPort-AV: E=Sophos;i="5.42,357,1500912000"; d="scan'208";a="25380962" From: Dou Liyang To: , CC: , , , , Dou Liyang Subject: [PATCH 2/2] x86/apic: Convert APIC_INTEGRATED to lapic_is_integrated() in apic.c Date: Thu, 7 Sep 2017 16:49:21 +0800 Message-ID: <1504774161-7137-2-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1504774161-7137-1-git-send-email-douly.fnst@cn.fujitsu.com> References: <1504774161-7137-1-git-send-email-douly.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 36AAF472556D.A1D32 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1563 Lines: 60 Currently, lapic_is_integrated() encapsulates APIC_INTEGRATED() in apic.c for a concise call. But lapic_get_maxlvt() is overlooked. Convert to lapic_is_integrated() and fix two code formats. No functionality change Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 63b3ae9..b81ebbf 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -294,14 +294,11 @@ int get_physical_broadcast(void) */ int lapic_get_maxlvt(void) { - unsigned int v; - - v = apic_read(APIC_LVR); /* * - we always have APIC integrated on 64bit mode * - 82489DXs do not report # of LVT entries */ - return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; + return lapic_is_integrated(void) ? GET_APIC_MAXLVT(v) : 2; } /* @@ -1256,7 +1253,9 @@ void __init init_bsp_APIC(void) */ apic_write(APIC_LVT0, APIC_DM_EXTINT); value = APIC_DM_NMI; - if (!lapic_is_integrated()) /* 82489DX */ + + /* Is 82489DX ? */ + if (!lapic_is_integrated()) value |= APIC_LVT_LEVEL_TRIGGER; if (apic_extnmi == APIC_EXTNMI_NONE) value |= APIC_LVT_MASKED; @@ -1484,7 +1483,9 @@ void setup_local_APIC(void) value = APIC_DM_NMI; else value = APIC_DM_NMI | APIC_LVT_MASKED; - if (!lapic_is_integrated()) /* 82489DX */ + + /* Is 82489DX ? */ + if (!lapic_is_integrated()) value |= APIC_LVT_LEVEL_TRIGGER; apic_write(APIC_LVT1, value); -- 2.5.5