From patchwork Mon Jun 4 15:04:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10446801 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 3178B60284 for ; Mon, 4 Jun 2018 15:05:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FDDD288B5 for ; Mon, 4 Jun 2018 15:05:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1431E2889A; Mon, 4 Jun 2018 15:05:52 +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 A70312889A for ; Mon, 4 Jun 2018 15:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753681AbeFDPFJ (ORCPT ); Mon, 4 Jun 2018 11:05:09 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:35602 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410AbeFDPFG (ORCPT ); Mon, 4 Jun 2018 11:05:06 -0400 Received: by mail-ot0-f194.google.com with SMTP id q17-v6so27467879otg.2; Mon, 04 Jun 2018 08:05:05 -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=7C1UUkX42fGrT+ctosUqxUcvqJzNq9BWz1TWH2q1c1Q=; b=FkwqjP8TlVIJL8WFiCqiK2fPLOmqKveZiRIchtHKB5pBw64XhI8QzomfutIV9Zo/BM NrUx4vvBbnGcUnoWcpXCc04H7S/M7gXLux+thJLgGGQplt5Bm2ZXo63cruAj1Th/0wZv 7sqv4dWNZriOqb2sqz+SfzBTBsprUIFLrwvlakWVN+fZssXnR0Rm2kKYxj0pSm06r47c SPIq0sPM7DLxh7KLwRC5gMBbCxNZ2600PwBSN3tKQX0pHApvLXDeQMn2VmUANeLEZMjy yvdzha/QTz7cuI7BXbNlkre0ali0RNPeGTSvBiCixIcZLod6a/YgS0VrikDVG1eG70ir EBSQ== 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=7C1UUkX42fGrT+ctosUqxUcvqJzNq9BWz1TWH2q1c1Q=; b=PbbvCd35H9KmSn23CZP3HWiY/DoAzBlmNg83vd+QI8wJIfSN0NfZmjiaTfK6xTt6Om swcQyCfrbfwGgyrmEZG+3UmdDOuoERpjwiBtRWtziDrPhzJVAoHd2hMaJuMIQF9UJzUH F4rlOXjZyoZW5VXq7H9wfLMK9yRm00jgHoytRNmoQ2kxK3eL+tkMaiJiIGTiOH8HPhzd prRFCzgcaUr1iXwsdQqo1B7YEpVDXZM+ngzyGsmhCBaNS0kqpLHH1BCWwJTW5hKMlU/x M3XC13AR+OLkfeKWup+jwmFP6gPsAcde50bHVAFs9ft4m3JuwvyGKtb3cp+nNBBhddht 1f7A== X-Gm-Message-State: ALKqPwf9xX6pUp1fbsBRnmbKhiVoKti8VOXnmmHlxrJpSGyxdAmEdeXE cFBqb3H1uY70kc7DpRn1j6iDa09WesIhyQ== X-Google-Smtp-Source: ADUXVKJQ2Q0dwMNS/F9OEA2So/JgMPTzVUFzh6lPNlruK9rdeVHxFndNXxdyfR5eqGTjn1EGJCEiyA== X-Received: by 2002:a9d:5c7:: with SMTP id 65-v6mr15740013otd.78.1528124705364; Mon, 04 Jun 2018 08:05:05 -0700 (PDT) Received: from austins740xd.raid.adc.delllabs.net ([143.166.81.254]) by smtp.gmail.com with ESMTPSA id n72-v6sm3878332oig.6.2018.06.04.08.05.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 08:05:04 -0700 (PDT) From: mrnuke X-Google-Original-From: mrnuke To: linux-acpi@vger.kernel.org, tony.luck@intel.com Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, "Rafael J. Wysocki" , Len Brown , Mauro Carvalho Chehab , Robert Moore , Erik Schmauss , Tyler Baicar , Will Deacon , James Morse , "Jonathan (Zhixiong) Zhang" , Dongjiu Geng , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, devel@acpica.org Subject: [PATCH v8 2/3] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 4 Jun 2018 10:04:39 -0500 Message-Id: <20180604150443.1265-3-mrnuke@austins740xd.dell> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180604150443.1265-1-mrnuke@austins740xd.dell> References: <20180604150443.1265-1-mrnuke@austins740xd.dell> 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 From: Alexandru Gagniuc 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 one GHES_SEV* value. 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 26a41bbe222b..1b22e18168f5 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)) @@ -467,10 +467,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; @@ -511,7 +511,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 @@ -533,7 +533,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; @@ -704,9 +704,8 @@ static int ghes_proc(struct ghes *ghes) if (rc) goto out; - if (ghes_severity(ghes->estatus->error_severity) >= GHES_SEV_FATAL) { + if (ghes_cper_severity(ghes->estatus->error_severity) >= GHES_SEV_FATAL) __ghes_panic(ghes); - } if (!ghes_estatus_cached(ghes->estatus)) { if (ghes_print_estatus(NULL, ghes->generic, ghes->estatus)) @@ -944,7 +943,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_FATAL) { oops_begin(); ghes_print_queued_estatus();