Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4442702imm; Tue, 7 Aug 2018 01:22:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRL7bfF/fy7lppdZ5joz3KR81wuoFXMriysk7t5b8qix9gcZIxIwMkqKg/w6SMtDSIX2w5 X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr17006629plp.212.1533630170607; Tue, 07 Aug 2018 01:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533630170; cv=none; d=google.com; s=arc-20160816; b=dQCZMzklR4PvFKpECRF59bXzIo4g7yTGFxX7FrWeyPu2UxQuF8nChrz5WyCu+W0/ta uDPy/9IPCTAGWAJIyp3arKdAm2eu+EGQlMejpz6VBli7/kmY0sQ6JVt+VF/HGkc11P1U UBAuB0G9W7NbHR8mpTY4TtDfZ2WgjK2GGV15Ugbu/HxbG3nW2zHXIXbNdrNLBWqjFshS EdoL8KSXIC2NDwKC1oz0g4LVw5hoxLc5M9TfNN5b1sv5WMjD/luRuGEox4zSB22FcHoQ b610liB33dO7WkpIZcrQEy9NsKOZYKSDB1WKwF8nMpyl7SxPupQj3Lelr3JGLKPenaqo oGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=oby95PEUDYDZK5r15s6YtcfrPgzQIJ5gL0+2dvE30DQ=; b=yaQteUwNk1jahGyRzy3gnrxvDNkwngrhsytzC1qoCRe0ZH+dBH6Y6QOBd/BsS1yqrd DYjLB3BPdmIRldgykjoUldNLdXYgrZ1ESuaXSvt/tFS1USL+cqxnfdMFQHZmNA/wBRRP XXCgZdcYpVtaLbBvW5cy7nvqXmKG7fAJP809inEWb1Bw+eiCuQ2eK34wT3de1Qt97LVu 69MZOka6nOrxbh9/zwfFqyQT4hyGtdJPbejQi+pllz/ac83/7YfmsS4bY/3QGYCKe/dI lZyu4bLsSkw05BNPaUTnkL2nJSXoIxTAu8ZwVh+wvN1mWbrZQIZkl0Ow4hG90SeINbeE EP/A== 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 33-v6si640140plh.16.2018.08.07.01.22.35; Tue, 07 Aug 2018 01:22:50 -0700 (PDT) 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 S1731257AbeHGKeh (ORCPT + 99 others); Tue, 7 Aug 2018 06:34:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10673 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726951AbeHGKeh (ORCPT ); Tue, 7 Aug 2018 06:34:37 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C38C4E5FA357D; Tue, 7 Aug 2018 16:21:19 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Tue, 7 Aug 2018 16:21:14 +0800 From: Dongjiu Geng To: , , , , , , , , CC: Subject: [PATCH RESEND v2] arm64: clean the additional checks before calling ghes_notify_sea() Date: Tue, 7 Aug 2018 12:26:15 -0400 Message-ID: <1533659175-47076-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- This cleanup is ever mentioned by Mark Rutland in [1] [1]: https://lkml.org/lkml/2018/5/31/289 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 */ -- 1.9.1