From patchwork Fri May 25 15:53:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10427871 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 A17146025B for ; Fri, 25 May 2018 15:55:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D79328889 for ; Fri, 25 May 2018 15:55:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 820C02895B; Fri, 25 May 2018 15:55:32 +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 2ECF928889 for ; Fri, 25 May 2018 15:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966895AbeEYPyO (ORCPT ); Fri, 25 May 2018 11:54:14 -0400 Received: from mail-ot0-f193.google.com ([74.125.82.193]:42777 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965666AbeEYPyN (ORCPT ); Fri, 25 May 2018 11:54:13 -0400 Received: by mail-ot0-f193.google.com with SMTP id l13-v6so6569395otk.9; Fri, 25 May 2018 08:54:12 -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=3MZ2jf2Wr7V21mRfILLuD57FZJxgPNXFE99WxwUQ22A=; b=IBuemA20G5oHUJ7bQs0utKuhYrZrYNMXBKynQXpfvW9wE5We3RZVXusGEgboOlpsxL Cb+P3Js/lNeKM2SJmgRHdvD6MnhQB+BitdHUUhX77hD64CoqORnBBrroiJy6AtU2LvAk bGDs1VmH5AgruK+9aUab8GNia8yUHLbITin/nYey1Bmi8jigXInOIu+rBm0k2P4F30Ek xRVApPjpMqyc2LE4CzqznpeYxUQCNTN6viF5uwpK1qIuRqdVzEBH8ZKL4FrOYit9ntbB rDh/la/yGjr46K73bbIFvJfpQorMvdAGpnr5cO5WEz+QL605NeqweXmiFdzCAjV8euas CGiQ== 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=3MZ2jf2Wr7V21mRfILLuD57FZJxgPNXFE99WxwUQ22A=; b=DyZWscnq40CL8VVnLsttjeDhsYC8zIELrsYx7ceB8RF3X61vhW8FdA0rpwz/eM/W2L 5SzVfpxVSqpgArEqwIzrFelyTBdd9k65VcQ5WVpr1DgleilRbfzbv2m9PkBt0DpzjQ0b h8OUSMBCSYymiqkUY8MQKE1s425acek1KqZ+0z0EC0ln6GQ7OrbfFuas1+JiM65E3CFU Zo2v3i8o3toSHA5ymlIT2NGeql9oc/+SJamlG/etBD8npWRk6UON4LE20060rrtp3Sgb zn3iHmVNYr6M8dezXcfH3tTe6dDep+3cF7BDV218PSyH0fzWRe0GfThGzZpYD0TyN9xq tQJg== X-Gm-Message-State: ALKqPwe9RYiReIp5POZKlgaDkshOgqEDS0sN6UUaqc0ag4b4HVPDdJWL wyQ5mlO2od1pq7UWJZXm8/h03w3+ X-Google-Smtp-Source: ADUXVKJ6RotmYdjQbaaBhsKhqcK/pHIwOrgvWf0xdL8YdIwNAwDc/027o1iwsj4HgjIYKcLTtFFpqw== X-Received: by 2002:a9d:1be1:: with SMTP id v30-v6mr1799321otv.59.1527263652341; Fri, 25 May 2018 08:54:12 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-201-114-184.hsd1.tx.comcast.net. [98.201.114.184]) by smtp.gmail.com with ESMTPSA id o206-v6sm2636856oia.35.2018.05.25.08.54.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 08:54:11 -0700 (PDT) From: Alexandru Gagniuc To: linux-acpi@vger.kernel.org Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , Tony Luck , 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 v7 2/3] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Fri, 25 May 2018 10:53:47 -0500 Message-Id: <20180525155352.22350-3-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180525155352.22350-1-mr.nuke.me@gmail.com> References: <20180525155352.22350-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 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();