Received: by 10.192.165.148 with SMTP id m20csp4240598imm; Mon, 30 Apr 2018 14:35:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrddj+E8GcYQG9DD+rumKvBHetdLekIdhaMAGOfJI23vGNI/nEjFQoFn9CA/kKds1HM2LD/ X-Received: by 10.98.220.78 with SMTP id t75mr13339116pfg.139.1525124106925; Mon, 30 Apr 2018 14:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525124106; cv=none; d=google.com; s=arc-20160816; b=W0UQe8Jeiza6SaYEwINK8V5OskcRo3MCCXVUUtjZYU9Bq9X9CQuGIRGLRioXW6kMJZ nfv/sLYoRmgC8Sf958xNUakctzp5MZ68W9y6gWFN4Ps2C7HZsDXOiNtuOWGvMJYAAj2S FOumWMA8RwixS07izDtLxNuTx8GR/Ybd/yT1M9TGoZnmc/FdIkw3Vlk8NB9XkanLVZ1N 5cSsGJjRbiMnooeLO8xok4OeMK7rmhKtb1uM2OfjZdkKEb5WNz4PtMkq/Ij9hySjIg6g E1ytnrFWcUWsqqU1/7Ee+UJXW29KNh8q0XBUWMm9BaGuYnGEah2C8yGEnrTqkvFAjj7V 7XzA== 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=nqXPz2AP3SSPAW9bjBFTJcdABpgwAjRchhBv9qjLcSc=; b=z3XnyDq466GVSRlG8fD32Z4vEvaP6X0GPY3qRvVOzQ3EMsfaXDC/KDxie6TNtCHELg EabtK4SOh+O4dpzEDIlMLT79WhBV2DfAir8aqGH+4bAALTxglcte8qB+JCkRyxyAHC9H TpthzQlew2SW//3zD2Hjttqb1F1KR9u+NglMHZwkM1jQvH0RlOoWwtYV9aw3qLsnB3FH VcaRBA6LB5HtRJMhvIaKcq1v17RLQBGCQDpi8N9HceIgbCAmllJrHL+hqv/rhndKyXv4 /7e1VcXjwPj0GJ/avG95oEn5Z0EwQf1u4lbgfkdsbdlVPpe4wyX2Ki+0LnaG0sNSeyyb aiAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RWE7udMs; 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 g187-v6si989603pgc.644.2018.04.30.14.34.52; Mon, 30 Apr 2018 14:35:06 -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=RWE7udMs; 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 S1755058AbeD3VeW (ORCPT + 99 others); Mon, 30 Apr 2018 17:34:22 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:34274 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861AbeD3VeS (ORCPT ); Mon, 30 Apr 2018 17:34:18 -0400 Received: by mail-oi0-f66.google.com with SMTP id l1-v6so8708085oii.1; Mon, 30 Apr 2018 14:34:17 -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=nqXPz2AP3SSPAW9bjBFTJcdABpgwAjRchhBv9qjLcSc=; b=RWE7udMsH+lq27D4j1n0FuUSn2UQ0y5RYnCieW2HrQrIaHw++q+ab7WPa1Rustv9Fg Whg7NGFiKE4JyHv9hVDbcoKhKZRXUIt764JMvBURriIYNE6ebHE/fmhgS0lDyudQuJg9 EYo6R7tMvdCCYs9WA+BAqFUqnJuX9HJmvGO04pURXnwNrJVpPfqDpRaEIiIwzv+cNT0K HisOI+TV+cHt1k0DuU6P4icEEJzpXcOIFjEXbFN36eWxLlEq16sMcflu0Uy1zb3QbJEJ dIZhe8QwYgi7Rm0M2sL7flsD8vcAPQFZfnWO1iblwPq8EInjpc7oCmVsUzlWMwqSY1hA XTiw== 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=nqXPz2AP3SSPAW9bjBFTJcdABpgwAjRchhBv9qjLcSc=; b=Zr4l+cFN5PLekRBR56s1cNQuH2vK9cR/GldVbIIc5GvVOxX8J6+tafN7XrAeolxhe6 hoskDvW5kWUPizMXNF4Ab+SrYBmVCHjIPERAXZCmo/xnHQSaV8OZ6mA2GYkSjm7045b0 m1YAUc5vJqG8zLwaCYdUIbS31DETQwn9XIdQy92s28XW2vSq/bef6uXNSaKItWuIAr3L PKHSbDhjKyL8DExVlFRCRg3FywYm6D2L9+4Vj53Nl9YJthN/Fac9wlUJkM5xxRIi3a5E vc8oMuCiQvgplTcZsC8fxhBoWibwnn3L0hPrPrm78ekd0MMl4yB132NRz+DCbhPv/Eca iiqg== X-Gm-Message-State: ALQs6tCqRVggtxcPzU0Ko3QaFwoMFHJNHEAGIQ5qlsTmU+SAUS5DImgm Uk6NTSLXtkzBC1q9teRHwxs= X-Received: by 2002:aca:cdd2:: with SMTP id d201-v6mr8622766oig.230.1525124057358; Mon, 30 Apr 2018 14:34:17 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id m3-v6sm1475866oif.50.2018.04.30.14.34.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 14:34:16 -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 , Mauro Carvalho Chehab , Robert Moore , Erik Schmauss , Tyler Baicar , Will Deacon , James Morse , Shiju Jose , "Jonathan (Zhixiong) Zhang" , Dongjiu Geng , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, devel@acpica.org Subject: [RFC PATCH v4 2/3] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 30 Apr 2018 16:33:51 -0500 Message-Id: <20180430213358.8319-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430213358.8319-1-mr.nuke.me@gmail.com> References: <20180430212836.7807-1-mr.nuke.me@gmail.com> <20180430213358.8319-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 a monotonically increasing number. 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 f9b53a6f55f3..c9f1971333c1 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(); -- 2.14.3