From patchwork Mon May 21 13:49:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10415383 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 ACF0160365 for ; Mon, 21 May 2018 13:50:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D4382892D for ; Mon, 21 May 2018 13:50:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9196628911; Mon, 21 May 2018 13:50:27 +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=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 2435928925 for ; Mon, 21 May 2018 13:50:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833AbeEUNuY (ORCPT ); Mon, 21 May 2018 09:50:24 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:39363 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbeEUNuV (ORCPT ); Mon, 21 May 2018 09:50:21 -0400 Received: by mail-io0-f195.google.com with SMTP id r9-v6so14378253iod.6; Mon, 21 May 2018 06:50:20 -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=1RcNUSOdjoV86166oI7h8YTTdvNJe9XOlojmCxmMiow=; b=c+dUCTtJIP+bfUmlXgXT19ISceskx/lamDkTnm57/la0CqKk/1uNAlH7YW8VV7rWqV gCEd11L1/2iLPRb3kBnpGT5F6H1L4dChql9S/RXEskr2oKSDRpKDFmdg+jyA2uUYUVYw L6X6bJFJwoBHS/lV3la+2bwx5oLdR/x3SwN/q7LsgprIGQOWkK2Wko6Mipct2LoPyZ3v LD7KPaEbW5d+F8AUF0vCRv9xPXnJeKYbD+qhLlCdzT9yDiLnDV0HqW6gn3ZpqCFqYLfZ a8bjmlLRkGs7+D9mFWqiZ3Xk9lLLqUwZvxM/YV4+oyIs8c6cyHTYCmGdtyjLwj3r0rvS fp1A== 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=1RcNUSOdjoV86166oI7h8YTTdvNJe9XOlojmCxmMiow=; b=nxfFHB9pnSkeddOu80Cg3iPoyWIHcMWm6evoAv6jXZXHeW7iq9XjzufHVrVuSChSBr UFOiXB9nT0cQIlDlVpR4dvZEII4tDKSRO7JUk+guDM/omq/sLyXZwG9AJY72MiKvt+Ug nd84PZl0UxqmeSwwxXGcvBiebsOuiSSIdHa/XfFHuxmTpbHLKfBsCcEkGOYWo7D4N0OI m/greEDpJkjbG3vrhFAA3AP/RBmYD4MfRzK4Q76a5swumaVK1LJuDJrcbGZzGZlucvls 1HUFEj6AO4pK5wtWOpxbH9hCj/0jQ6uLoqjBLujxRnrnJRCCdyqmpQlR+Kkf9qmUXVy4 xVvA== X-Gm-Message-State: ALKqPwe3Km4E0qIrZGV9UAMBGGkGGExmYfhlHDocq18dOSawZiigHF34 QxivSN+x3l1X1vWQe+34YE0= X-Google-Smtp-Source: AB8JxZrNx9FOmxWzds3pXx7D2jQbJdjDczkNoCsvpuir2xJoFOZGy5ll1W7zIAYGOAOD/YLVO/l7dg== X-Received: by 2002:a6b:c7c4:: with SMTP id x187-v6mr21571921iof.227.1526910620072; Mon, 21 May 2018 06:50:20 -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 f4-v6sm8432212itf.22.2018.05.21.06.50.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 06:50:19 -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 , Tyler Baicar , Will Deacon , James Morse , Shiju Jose , "Jonathan (Zhixiong) Zhang" , Dongjiu Geng , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/2] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 21 May 2018 08:49:58 -0500 Message-Id: <20180521135003.32459-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180521135003.32459-1-mr.nuke.me@gmail.com> References: <20180521135003.32459-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 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 1efefe919555..7c1a16b106ba 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();