Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3633111imm; Fri, 25 May 2018 08:56:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpmkQ4DrL3PCegzhb8kd6OGrougyRLLCz3Kb3As9sOyhM3+t4ToZGrHz+4KiaR+FazgB85N X-Received: by 2002:a63:70a:: with SMTP id 10-v6mr2550100pgh.216.1527263806015; Fri, 25 May 2018 08:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527263805; cv=none; d=google.com; s=arc-20160816; b=I8qWVqXH94xAUdyAymMNkbK6caonSvgqI4u3lvhlOceTEB/Jq+YeA6u9/PuDHVFBQV PpZf0i9cP5vf5ki8dd8IagMWa11gFRSznqEWZgX8xzFAh8IZzDZEYHdZ9O5IclBKq4UL Gb9I7nzgXlOlBzTEWmjI7z6BIoauhnc/4SpMUkNayTwkSCOu1un/SYXnSynwlMOPrRJV c1nm2QVdYH7Zdo6BbeWlbzKWafxXKHFlPNSGwOrqwoVrStl9DZaRSmnNoCjzap2gP63n 0riZeoVjNoGBd6/W55ZySxroTJs0uRxh/l/SjW3tAq3fuY+sccruEwY+YPav1KcRqXD1 XorQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3MZ2jf2Wr7V21mRfILLuD57FZJxgPNXFE99WxwUQ22A=; b=mDloiYHGTH751Nuu2HyHIfw/fCbgVjZKlMgNqCzzIGTPZHMduAbRe9+ibfhzuwSbK+ 0G2ulC4V1NQmk8FhnVtHiOyqW8zAOg57Ibn73rHGYnpfGylE3H70o1Sud8901gfAu5Vy zBA9bCKRomkiuueB/QSgH3sgcV5Pzf8WkldBVfezQ2pzf6beHkf2H/SbsDHHKCkAOz0x JH/+zMEb6rYKazlo0tgnwDrcURLK9T8d+M9IqC4CCLIeddMxXWKF+rFrZdSgCcEq3nXD kWz4tsJmXvwjdhDoXFwCEPX3F1xb6X2R+dp7RCJ9I4laHrfCx3V+jXmRBkb0x4gKP68u Wcgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBuemA20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si24549757plq.160.2018.05.25.08.56.31; Fri, 25 May 2018 08:56:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IBuemA20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967141AbeEYPyP (ORCPT + 99 others); Fri, 25 May 2018 11:54:15 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.14.3