diff mbox series

errorlog: Replace hardcode value with macro

Message ID 20200225111304.25611-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series errorlog: Replace hardcode value with macro | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (f123417068e51842004bdc047c8c5107b70442ef)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde Feb. 25, 2020, 11:13 a.m. UTC
Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 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(-)

Comments

Oliver O'Halloran March 6, 2020, 3:30 a.m. UTC | #1
On Tue, Feb 25, 2020 at 10:13 PM Vasant Hegde
<hegdevasant@linux.vnet.ibm.com> wrote:
>
> Suggested-by: Oliver O'Halloran <oohall@gmail.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Thanks, merged as c8418ac7945db2c73c458093576881d806d7e81d
diff mbox series

Patch

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,		\