Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3711498imm; Mon, 4 Jun 2018 08:05:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLeXlp+x4x+0AF1zlIGc4h0stN73vgM4eWkRDa6a1NVRQbtOGL7suedJyPkdtMJfyKxt6uJ X-Received: by 2002:a17:902:bc89:: with SMTP id bb9-v6mr9992447plb.84.1528124759849; Mon, 04 Jun 2018 08:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528124759; cv=none; d=google.com; s=arc-20160816; b=md9u0AfSFKPGA4OcL74GOT9gREMoRp48c++dJ3qAOCOr3bWGY/9YL+tF4CoUBPrBPB asuRJn8cVJfKiYpwX9AG1ozQ6f+WpEV4/GIGojT36W5I+n31QJVdl99IphsSzOCAJn9u kB3M62/FfQp5XCk1WxSRAh4zMlbAbDFjQap8whOAmY1fCQJpiQYExDNfT3XAb1XP8oPv gNRZz8fuUBKLT+FPBGjTA4n6/aAbmpHdiat9HIpaafUJP28IWFxBIH24Qzyb0ftUQdyE xpbO1i426ElFAUL6+FxKYPIpOqXfMRsXm2PlhRVuQOSVYpFRcFWjmae8ogp1faatF2AK etnw== 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=7C1UUkX42fGrT+ctosUqxUcvqJzNq9BWz1TWH2q1c1Q=; b=yS0QPN6zqIrZdlQCXl72TItCj/EU3vDXsIchcNsEdAV7Q0O0Zui1FdLcBF69mxPYDM FGEmktN0Z7Qj5h32mnqxelef9UlAdNOyse8/MBCRk0SHpBQHkx4MqOyAEkmSSP4SFohB m+eEtTqvIEaJynXAhWrYzihkoptuD+tY+grngrg3H6p+NZzYcj99/c8saicmi94bIyQQ iO3evOldDVdAkiWq9PDeUO6nuBkwOp1eG0RdiVgZ3BwtDahsSX29KVD693++vFcgSBhA 8Dt/k7BEF21JKRESFFgA4d5+QXtdyJ8SI3Xl3r03e8vATUd7dzMBZbp1YKAo/HO8LP8v LTFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FkwqjP8T; 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 c5-v6si47620321pfm.119.2018.06.04.08.05.45; Mon, 04 Jun 2018 08:05:59 -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=FkwqjP8T; 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 S1753879AbeFDPFJ (ORCPT + 99 others); Mon, 4 Jun 2018 11:05:09 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:35602 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410AbeFDPFG (ORCPT ); Mon, 4 Jun 2018 11:05:06 -0400 Received: by mail-ot0-f194.google.com with SMTP id q17-v6so27467879otg.2; Mon, 04 Jun 2018 08:05:05 -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=7C1UUkX42fGrT+ctosUqxUcvqJzNq9BWz1TWH2q1c1Q=; b=FkwqjP8TlVIJL8WFiCqiK2fPLOmqKveZiRIchtHKB5pBw64XhI8QzomfutIV9Zo/BM NrUx4vvBbnGcUnoWcpXCc04H7S/M7gXLux+thJLgGGQplt5Bm2ZXo63cruAj1Th/0wZv 7sqv4dWNZriOqb2sqz+SfzBTBsprUIFLrwvlakWVN+fZssXnR0Rm2kKYxj0pSm06r47c SPIq0sPM7DLxh7KLwRC5gMBbCxNZ2600PwBSN3tKQX0pHApvLXDeQMn2VmUANeLEZMjy yvdzha/QTz7cuI7BXbNlkre0ali0RNPeGTSvBiCixIcZLod6a/YgS0VrikDVG1eG70ir EBSQ== 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=7C1UUkX42fGrT+ctosUqxUcvqJzNq9BWz1TWH2q1c1Q=; b=PbbvCd35H9KmSn23CZP3HWiY/DoAzBlmNg83vd+QI8wJIfSN0NfZmjiaTfK6xTt6Om swcQyCfrbfwGgyrmEZG+3UmdDOuoERpjwiBtRWtziDrPhzJVAoHd2hMaJuMIQF9UJzUH F4rlOXjZyoZW5VXq7H9wfLMK9yRm00jgHoytRNmoQ2kxK3eL+tkMaiJiIGTiOH8HPhzd prRFCzgcaUr1iXwsdQqo1B7YEpVDXZM+ngzyGsmhCBaNS0kqpLHH1BCWwJTW5hKMlU/x M3XC13AR+OLkfeKWup+jwmFP6gPsAcde50bHVAFs9ft4m3JuwvyGKtb3cp+nNBBhddht 1f7A== X-Gm-Message-State: ALKqPwf9xX6pUp1fbsBRnmbKhiVoKti8VOXnmmHlxrJpSGyxdAmEdeXE cFBqb3H1uY70kc7DpRn1j6iDa09WesIhyQ== X-Received: by 2002:a9d:5c7:: with SMTP id 65-v6mr15740013otd.78.1528124705364; Mon, 04 Jun 2018 08:05:05 -0700 (PDT) Received: from austins740xd.raid.adc.delllabs.net ([143.166.81.254]) by smtp.gmail.com with ESMTPSA id n72-v6sm3878332oig.6.2018.06.04.08.05.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Jun 2018 08:05:04 -0700 (PDT) From: mrnuke X-Google-Original-From: mrnuke To: linux-acpi@vger.kernel.org, tony.luck@intel.com Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , 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 v8 2/3] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Date: Mon, 4 Jun 2018 10:04:39 -0500 Message-Id: <20180604150443.1265-3-mrnuke@austins740xd.dell> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180604150443.1265-1-mrnuke@austins740xd.dell> References: <20180604150443.1265-1-mrnuke@austins740xd.dell> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandru Gagniuc 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