From dc15df882b56ec2abff2a5bba45238309a02f5e9 Mon Sep 17 00:00:00 2001
From: FuJia Ni <nifujia1@hisilicon.com>
Date: Thu, 25 May 2023 09:36:39 +0800
Subject: [PATCH 18/18] hikptool: fix print sas_dqe info error problem

the volatile modifier is added because the O2 compilation optimization is enbaled.
As a result, the pointer data is not updated.

Signed-off-by: FuJia Ni <nifujia1@hisilicon.com>
---
 sas/sas_func/sas_read_dqe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sas/sas_func/sas_read_dqe.c b/sas/sas_func/sas_read_dqe.c
index fc04682..2f653df 100644
--- a/sas/sas_func/sas_read_dqe.c
+++ b/sas/sas_func/sas_read_dqe.c
@@ -47,7 +47,7 @@ static int sas_get_dqe(const struct tool_sas_cmd *cmd, uint32_t *reg_save, uint3
 
 static void print_dqe_info(const void *reg_save, uint32_t reg_num)
 {
-	struct hisi_sas_dq_info *dqe = (struct hisi_sas_dq_info *)(reg_save);
+	volatile struct hisi_sas_dq_info *dqe = (volatile struct hisi_sas_dq_info *)(reg_save);
 
 	printf("The dqe dw0 information as below:\n");
 	printf("abort_flag: %u\n", dqe->dw0.abort_flag);
-- 
2.25.1

