From patchwork Sat Aug 11 04:35:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10563255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD4A513BB for ; Sat, 11 Aug 2018 04:36:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B492F29F33 for ; Sat, 11 Aug 2018 04:36:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 912E62ADB3; Sat, 11 Aug 2018 04:36:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7863E29F33 for ; Sat, 11 Aug 2018 04:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbeHKHJ1 (ORCPT ); Sat, 11 Aug 2018 03:09:27 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10700 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726858AbeHKHJ0 (ORCPT ); Sat, 11 Aug 2018 03:09:26 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AFE67C9BD85C3; Sat, 11 Aug 2018 12:36:35 +0800 (CST) Received: from SHA150392835-N.china.huawei.com (10.45.59.148) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.399.0; Sat, 11 Aug 2018 12:36:26 +0800 From: Dongjiu Geng To: , , , , , , , , , , , CC: Tyler Baicar Subject: [PATCH RESEND v3] arm64: clean the additional checks before calling ghes_notify_sea() Date: Sat, 11 Aug 2018 12:35:47 +0800 Message-ID: <20180811043547.560-1-gengdongjiu@huawei.com> X-Mailer: git-send-email 2.11.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.45.59.148] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to remove the additional check before calling the ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA. After this cleanup, we can simply call the ghes_notify_sea() to let APEI driver handle the SEA notification. CC: Tyler Baicar CC: James Morse Signed-off-by: Dongjiu Geng Acked-by: Will Deacon Reviewed-by: Tyler Baicar --- This cleanup is ever mentioned by Mark Rutland in [1] [1]: https://lkml.org/lkml/2018/5/31/289 change since v2: 1. Add 'Reviewed-by' of Tyler change since v1: 1. Update the commit messages 2. CC Tyler and James 3. Add 'Acked-by' of Will --- arch/arm64/mm/fault.c | 7 +------ include/acpi/ghes.h | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index b8eecc7..9ffe01d 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) int handle_guest_sea(phys_addr_t addr, unsigned int esr) { - int ret = -ENOENT; - - if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) - ret = ghes_notify_sea(); - - return ret; + return ghes_notify_sea(); } asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr, diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 1624e2b..82cb4eb 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata) (void *)section - (void *)(estatus + 1) < estatus->data_length; \ section = acpi_hest_get_next(section)) +#ifdef CONFIG_ACPI_APEI_SEA int ghes_notify_sea(void); +#else +static inline int ghes_notify_sea(void) { return -ENOENT; } +#endif #endif /* GHES_H */