From patchwork Mon Apr 30 21:33:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10372961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E88D60116 for ; Mon, 30 Apr 2018 21:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D80128BA7 for ; Mon, 30 Apr 2018 21:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0139828BAB; Mon, 30 Apr 2018 21:34:48 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 A141A28BA7 for ; Mon, 30 Apr 2018 21:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754338AbeD3VeU (ORCPT ); Mon, 30 Apr 2018 17:34:20 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:34274 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861AbeD3VeS (ORCPT ); Mon, 30 Apr 2018 17:34:18 -0400 Received: by mail-oi0-f66.google.com with SMTP id l1-v6so8708085oii.1; Mon, 30 Apr 2018 14:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nqXPz2AP3SSPAW9bjBFTJcdABpgwAjRchhBv9qjLcSc=; b=RWE7udMsH+lq27D4j1n0FuUSn2UQ0y5RYnCieW2HrQrIaHw++q+ab7WPa1Rustv9Fg Whg7NGFiKE4JyHv9hVDbcoKhKZRXUIt764JMvBURriIYNE6ebHE/fmhgS0lDyudQuJg9 EYo6R7tMvdCCYs9WA+BAqFUqnJuX9HJmvGO04pURXnwNrJVpPfqDpRaEIiIwzv+cNT0K HisOI+TV+cHt1k0DuU6P4icEEJzpXcOIFjEXbFN36eWxLlEq16sMcflu0Uy1zb3QbJEJ dIZhe8QwYgi7Rm0M2sL7flsD8vcAPQFZfnWO1iblwPq8EInjpc7oCmVsUzlWMwqSY1hA XTiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nqXPz2AP3SSPAW9bjBFTJcdABpgwAjRchhBv9qjLcSc=; b=Zr4l+cFN5PLekRBR56s1cNQuH2vK9cR/GldVbIIc5GvVOxX8J6+tafN7XrAeolxhe6 hoskDvW5kWUPizMXNF4Ab+SrYBmVCHjIPERAXZCmo/xnHQSaV8OZ6mA2GYkSjm7045b0 m1YAUc5vJqG8zLwaCYdUIbS31DETQwn9XIdQy92s28XW2vSq/bef6uXNSaKItWuIAr3L PKHSbDhjKyL8DExVlFRCRg3FywYm6D2L9+4Vj53Nl9YJthN/Fac9wlUJkM5xxRIi3a5E vc8oMuCiQvgplTcZsC8fxhBoWibwnn3L0hPrPrm78ekd0MMl4yB132NRz+DCbhPv/Eca iiqg== X-Gm-Message-State: ALQs6tCqRVggtxcPzU0Ko3QaFwoMFHJNHEAGIQ5qlsTmU+SAUS5DImgm Uk6NTSLXtkzBC1q9teRHwxs= X-Google-Smtp-Source: AB8JxZr4U9ji2L9zVYm1q0u3lFtAyCQnjph7yyrIKx3myTDL9MI3vqQgwpeuLtcfKXFHs0+CkYWwaA== X-Received: by 2002:aca:cdd2:: with SMTP id d201-v6mr8622766oig.230.1525124057358; Mon, 30 Apr 2018 14:34:17 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id m3-v6sm1475866oif.50.2018.04.30.14.34.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 14:34:16 -0700 (PDT) From: Alexandru Gagniuc To: bp@alien8.de Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , "Rafael J. Wysocki" , Len Brown , Tony Luck , Mauro Carvalho Chehab , Robert Moore , Erik Schmauss , Tyler Baicar , Will Deacon , James Morse , Shiju Jose , "Jonathan (Zhixiong) Zhang" , Dongjiu Geng , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, devel@acpica.org Subject: [RFC PATCH v4 2/3] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 30 Apr 2018 16:33:51 -0500 Message-Id: <20180430213358.8319-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430213358.8319-1-mr.nuke.me@gmail.com> References: <20180430212836.7807-1-mr.nuke.me@gmail.com> <20180430213358.8319-1-mr.nuke.me@gmail.com> 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 ghes_severity() is a misnomer in this case, as it implies the severity of the entire GHES structure. Instead, it maps one CPER value to a monotonically increasing number. ghes_cper_severity() is clearer. Signed-off-by: Alexandru Gagniuc --- drivers/acpi/apei/ghes.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index f9b53a6f55f3..c9f1971333c1 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -271,7 +271,7 @@ static void ghes_fini(struct ghes *ghes) unmap_gen_v2(ghes); } -static inline int ghes_severity(int severity) +static inline int ghes_cper_severity(int severity) { switch (severity) { case CPER_SEV_INFORMATIONAL: @@ -388,7 +388,7 @@ static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int #ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE unsigned long pfn; int flags = -1; - int sec_sev = ghes_severity(gdata->error_severity); + int sec_sev = ghes_cper_severity(gdata->error_severity); struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata); if (!(mem_err->validation_bits & CPER_MEM_VALID_PA)) @@ -468,10 +468,10 @@ static void ghes_do_proc(struct ghes *ghes, guid_t *fru_id = &NULL_UUID_LE; char *fru_text = ""; - sev = ghes_severity(estatus->error_severity); + sev = ghes_cper_severity(estatus->error_severity); apei_estatus_for_each_section(estatus, gdata) { sec_type = (guid_t *)gdata->section_type; - sec_sev = ghes_severity(gdata->error_severity); + sec_sev = ghes_cper_severity(gdata->error_severity); if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) fru_id = (guid_t *)gdata->fru_id; @@ -512,7 +512,7 @@ static void __ghes_print_estatus(const char *pfx, char pfx_seq[64]; if (pfx == NULL) { - if (ghes_severity(estatus->error_severity) <= + if (ghes_cper_severity(estatus->error_severity) <= GHES_SEV_CORRECTED) pfx = KERN_WARNING; else @@ -534,7 +534,7 @@ static int ghes_print_estatus(const char *pfx, static DEFINE_RATELIMIT_STATE(ratelimit_uncorrected, 5*HZ, 2); struct ratelimit_state *ratelimit; - if (ghes_severity(estatus->error_severity) <= GHES_SEV_CORRECTED) + if (ghes_cper_severity(estatus->error_severity) <= GHES_SEV_CORRECTED) ratelimit = &ratelimit_corrected; else ratelimit = &ratelimit_uncorrected; @@ -705,9 +705,8 @@ static int ghes_proc(struct ghes *ghes) if (rc) goto out; - if (ghes_severity(ghes->estatus->error_severity) >= GHES_SEV_PANIC) { + if (ghes_cper_severity(ghes->estatus->error_severity) >= GHES_SEV_PANIC) __ghes_panic(ghes); - } if (!ghes_estatus_cached(ghes->estatus)) { if (ghes_print_estatus(NULL, ghes->generic, ghes->estatus)) @@ -945,7 +944,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) ret = NMI_HANDLED; } - sev = ghes_severity(ghes->estatus->error_severity); + sev = ghes_cper_severity(ghes->estatus->error_severity); if (sev >= GHES_SEV_PANIC) { oops_begin(); ghes_print_queued_estatus();