Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4622775imm; Mon, 14 May 2018 10:06:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrO6WaJKYuhCfAc8DV4Ob6p+MSW6inhw+5Inq9+Yes3HU2RXTok5hIr7KodWdot2gfRzp5O X-Received: by 2002:a62:23d7:: with SMTP id q84-v6mr11329218pfj.31.1526317610228; Mon, 14 May 2018 10:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526317610; cv=none; d=google.com; s=arc-20160816; b=MPOM2kmubDMbQHcbRzggEiHKO/jAweQVACr8EzhauMPFBN3oWJHB3TM/g6NJsQiVRu V4dF6ZQEzyTkf/2EH38vLRX1RdL1gJgUMQLh4QnP+KW5GQqVFp5Jhekhi7S4rIvSvLBU gbHcsSA+JFmm2onHRJ2GwOWFCr4zrJMJwRFUplZEBpOvGVvSppl/4LPtp5LgXuVYLCRL nf0sWhHbIoavOInrOM39VueOCVDhp4NG8k0GVTSCIiVnjSIs1QmnOiLXQEohHw3dCniX ryxt5snotbq7zQhsx7IpMnovH61SWSVJooPkznoWSt+afDVc3RhTl2Q2GGdWrvC59Uqd wbmw== 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=1RcNUSOdjoV86166oI7h8YTTdvNJe9XOlojmCxmMiow=; b=jl6tMzyxeI1JsrMUpPqNrSu6bBHp5vtwGV70eQzpSNc8Rus5n4SDX6gCZysGgsreVi HerKxo38HLDU4ddVkws2jWkm7JXKasVBclSLKyrLTBR+p3suwrvtuKV/7Og1gBOSJSvZ Kr4FMygOMaFVfSndDod+CElkQAcQ6o1rLq0qdnfNGr2c4FveudUlNquIeWmSSmsR6Dz2 dui/OzNW+CRC7pJ5LqPXLFuiVjOxjS5gEgSwHa72DZ/7hVCTfM3qO8lo8Pcy7JvGY8yC wRQvHewqPN3R2twr7Kne8ggWeDQblJn6zAYdSoyckIK70WFFZcnG4iuTb0VohzR+dxv4 61KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AExduqCG; 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 p7-v6si7763124pgd.96.2018.05.14.10.06.35; Mon, 14 May 2018 10:06:50 -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=AExduqCG; 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 S1754244AbeENO76 (ORCPT + 99 others); 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-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-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 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(); -- 2.14.3