From 457cbfa911d91d7cb7235a3fec4fb2a109dc65b9 Mon Sep 17 00:00:00 2001 From: gabrpham_amdeng Date: Wed, 21 May 2025 14:29:41 -0500 Subject: [PATCH] [SWDEV-533218] Changed array init method in rsmi_event_notification_get to more standard method Signed-off-by: gabrpham_amdeng --- rocm_smi/src/rocm_smi.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rocm_smi/src/rocm_smi.cc b/rocm_smi/src/rocm_smi.cc index 9fa3a929f4..9d772ae9ed 100644 --- a/rocm_smi/src/rocm_smi.cc +++ b/rocm_smi/src/rocm_smi.cc @@ -7222,7 +7222,7 @@ rsmi_event_notification_get(int timeout_ms, uint32_t event; char event_in[MAX_EVENT_NOTIFICATION_MSG_SIZE]; - memcpy(reinterpret_cast(event_in), "\0", MAX_EVENT_NOTIFICATION_MSG_SIZE); + memset(event_in, '\0', MAX_EVENT_NOTIFICATION_MSG_SIZE); while (fgets(event_in, MAX_EVENT_NOTIFICATION_MSG_SIZE, anon_fp)) { /* Output is in format as "event_number message_information\n" * Both event are expressed in hex. @@ -7241,7 +7241,7 @@ rsmi_event_notification_get(int timeout_ms, { uint32_t pid; char task_name[MAX_EVENT_NOTIFICATION_MSG_SIZE]; - memcpy(reinterpret_cast(task_name), "\0", MAX_EVENT_NOTIFICATION_MSG_SIZE); + memset(task_name, '\0', MAX_EVENT_NOTIFICATION_MSG_SIZE); sscanf(message, "%x:%s\n", &pid, task_name); std::stringstream final_message; @@ -7268,7 +7268,7 @@ rsmi_event_notification_get(int timeout_ms, { uint32_t reset_seq_num; char reset_cause[MAX_EVENT_NOTIFICATION_MSG_SIZE]; - memcpy(reinterpret_cast(reset_cause), "\0", MAX_EVENT_NOTIFICATION_MSG_SIZE); + memset(reset_cause, '\0', MAX_EVENT_NOTIFICATION_MSG_SIZE); sscanf(message, "%x %[^\n]\n", &reset_seq_num, reset_cause); std::stringstream final_message; @@ -7459,7 +7459,7 @@ rsmi_event_notification_get(int timeout_ms, ++(*num_elem); // zero out event_in after each use - memcpy(reinterpret_cast(event_in), "\0", MAX_EVENT_NOTIFICATION_MSG_SIZE); + memset(event_in, '\0', MAX_EVENT_NOTIFICATION_MSG_SIZE); if (*num_elem >= buffer_size) { break;