From patchwork Mon May 14 14:59:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10398661 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 4AD97600D0 for ; Mon, 14 May 2018 15:00:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A0D9281E1 for ; Mon, 14 May 2018 15:00:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C85528329; Mon, 14 May 2018 15:00:43 +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 C7B5F281E1 for ; Mon, 14 May 2018 15:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754235AbeENO76 (ORCPT ); Mon, 14 May 2018 10:59:58 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:51139 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbeENO7z (ORCPT ); Mon, 14 May 2018 10:59:55 -0400 Received: by mail-it0-f66.google.com with SMTP id p3-v6so10980533itc.0; Mon, 14 May 2018 07:59:54 -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=AExduqCGRV4HDXKLYQJuyzGq2noeUz7GRstZI1q+dd4h8bi1tzMxPZvmjf/VsRtDR5 GgMzidogAq4tumQA6xvdBxK0ZIKoVJeQ/AH2bsqLHJtuF2dzH9UGlbkrpzZ79zNqFoko ShXo0XNnOVZx47YkH9PZ6LvUO3M/bAuqTZKqWVirPEWaR2cumDyxmK262apm1yoYS54u NtRk0r84Mn+AiWfSGgiVN7BKpQ8LU1P6Ne6mQTPYXJTGjVDL21CLg4kDIf/H8rhgt51u iQa33B44TTZFtNxnwYy8E9InYy/VbSfu0H6mlvjkIIvQFqXpD9FewwIWd2urwWTcqASt Mxlg== 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=CIwaPL82Ybz29BrM8nal/9laGoPVTFti8HKJPx6SGdXa1t0XyF8DHj2Mr+4Gq/Mi2z QYBNjIQg370tHtPKNCD0UgS07g/Kb9PJu2Hz2Hyo1rk4/lmoq4H7OUn2JollRYiYeXa5 SopgXZRIs1MfyBYZSWVRI0P7ocVp9xQ9MB3KRS7UAQx8IN9cY0rwAOliA8m1dX4DOsEh fhkRvbLQ1HxCU2sn+S+7O2KexwbvwpuRdYwcnggetSSPGZKIoeEAh3eW+GrwV3Ne+5RC vf9fh5qTCPMqH1wI00Ih51gGfVXQlU0/1MOZ68EEXOHf/9O3lLi4mdiG91oI2SvJUmIK PHAw== X-Gm-Message-State: ALKqPweqrdudDeaai51gdxBb3UNNw8kAuzADaM8qR/yCylWsfuTl99x+ z4/+AVppQBvjFJT/3DQR8yQ= X-Google-Smtp-Source: AB8JxZq9yDGy5xgkKhU7BpSwn1ZxtkDr06kAvpv4kAXmRCWp5z749RZYA8c+uCT5Z6QRW2fmm4AYxQ== X-Received: by 2002:a6b:307:: with SMTP id 7-v6mr11739337iod.66.1526309993692; Mon, 14 May 2018 07:59:53 -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 y14-v6sm4653715ioc.52.2018.05.14.07.59.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 07:59:52 -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 v5 1/2] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 14 May 2018 09:59:28 -0500 Message-Id: <20180514145933.10291-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180514145933.10291-1-mr.nuke.me@gmail.com> References: <20180430212836.7807-1-mr.nuke.me@gmail.com> <20180514145933.10291-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();