From patchwork Tue Feb 25 11:13:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1244003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48RbsS6X32z9sP7 for ; Tue, 25 Feb 2020 22:13:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48RbsS5ZVkzDqSL for ; Tue, 25 Feb 2020 22:13:48 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48RbsF679KzDqSF for ; Tue, 25 Feb 2020 22:13:37 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01PBBt8i086857 for ; Tue, 25 Feb 2020 06:13:34 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yayb0p293-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Feb 2020 06:13:30 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Feb 2020 11:13:15 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 25 Feb 2020 11:13:13 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01PBDDQE48365690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Feb 2020 11:13:13 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D87C442041; Tue, 25 Feb 2020 11:13:12 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D952542042; Tue, 25 Feb 2020 11:13:11 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.193.108.153]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 25 Feb 2020 11:13:11 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Tue, 25 Feb 2020 16:43:04 +0530 X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20022511-0012-0000-0000-0000038A1735 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20022511-0013-0000-0000-000021C6B995 Message-Id: <20200225111304.25611-1-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-25_03:2020-02-21, 2020-02-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 suspectscore=1 spamscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002250091 Subject: [Skiboot] [PATCH] errorlog: Replace hardcode value with macro X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Suggested-by: Oliver O'Halloran Signed-off-by: Vasant Hegde --- core/errorlog.c | 2 +- core/platform.c | 2 +- core/test/run-pel.c | 2 +- hw/fsp/fsp-mem-err.c | 4 ++-- include/errorlog.h | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/errorlog.c b/core/errorlog.c index fd316836f..12bc91395 100644 --- a/core/errorlog.c +++ b/core/errorlog.c @@ -93,7 +93,7 @@ void log_add_section(struct errorlog *buf, uint32_t tag) tmp = (struct elog_user_data_section *)(buf->user_data_dump + buf->user_section_size); /* Use DESC if no other tag provided */ - tmp->tag = tag ? cpu_to_be32(tag) : cpu_to_be32(0x44455343); + tmp->tag = tag ? cpu_to_be32(tag) : cpu_to_be32(OPAL_ELOG_SEC_DESC); tmp->size = cpu_to_be16(size); buf->user_section_size += size; diff --git a/core/platform.c b/core/platform.c index 97bc7cb6f..0631cdf6c 100644 --- a/core/platform.c +++ b/core/platform.c @@ -94,7 +94,7 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag) "OPAL: Reboot requested due to Platform error."); if (diag) { /* Add user section "DESC" */ - log_add_section(buf, 0x44455343); + log_add_section(buf, OPAL_ELOG_SEC_DESC); log_append_data(buf, diag, strlen(diag)); } log_commit(buf); diff --git a/core/test/run-pel.c b/core/test/run-pel.c index 92215941e..17f033e61 100644 --- a/core/test/run-pel.c +++ b/core/test/run-pel.c @@ -101,7 +101,7 @@ int main(void) buffer = elog->user_data_dump + elog->user_section_size; tmp = (struct elog_user_data_section *)buffer; - tmp->tag = 0x44455343; /* ASCII of DESC */ + tmp->tag = OPAL_ELOG_SEC_DESC; /* ASCII of DESC */ tmp->size = size + sizeof(struct elog_user_data_section) - 1; strcpy(tmp->data_dump, "Hello World!"); elog->user_section_size += tmp->size; diff --git a/hw/fsp/fsp-mem-err.c b/hw/fsp/fsp-mem-err.c index d64558a49..27450061b 100644 --- a/hw/fsp/fsp-mem-err.c +++ b/hw/fsp/fsp-mem-err.c @@ -233,7 +233,7 @@ send_response: log_append_msg(buf, "OPAL_MEM_ERR: Cannot queue up memory " "resilience error event to the OS"); - log_add_section(buf, 0x44455350); + log_add_section(buf, OPAL_ELOG_SEC_DESC); log_append_data(buf, (char *) &mem_err_evt, sizeof(struct OpalMemoryErrorData)); log_commit(buf); @@ -322,7 +322,7 @@ send_response: log_append_msg(buf, "OPAL_MEM_ERR: Cannot queue up memory " "deallocation error event to the OS"); - log_add_section(buf, 0x44455350); + log_add_section(buf, OPAL_ELOG_SEC_DESC); log_append_data(buf, (char *)&mem_err_evt, sizeof(struct OpalMemoryErrorData)); log_commit(buf); diff --git a/include/errorlog.h b/include/errorlog.h index a01ab97be..66732d72f 100644 --- a/include/errorlog.h +++ b/include/errorlog.h @@ -324,6 +324,8 @@ enum opal_reasoncode { OPAL_RC_CONSOLE_HANG = OPAL_SRC_COMPONENT_CONSOLE | 0x10, }; +#define OPAL_ELOG_SEC_DESC 0x44455343 + #define DEFINE_LOG_ENTRY(reason, type, id, subsys, \ severity, subtype) static struct opal_err_info err_##reason = \ { .reason_code = reason, .err_type = type, .cmp_id = id, \