From c0f8dd5ae8fe688825e77cf63ddb30d0cb27ecdf Mon Sep 17 00:00:00 2001
From: veega2022 <zhuweijia@huawei.com>
Date: Thu, 11 May 2023 08:54:09 +0800
Subject: [PATCH 08/18] optimize the nic_mac dump register

if reg dump block data num is 0, print not support dump and return.
hikptool version: 1.0.14

Signed-off-by: veega2022 <zhuweijia@huawei.com>
---
 net/nic/nic_mac/hikp_nic_mac_dump.c | 5 +++++
 tool_lib/tool_lib.h                 | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/nic/nic_mac/hikp_nic_mac_dump.c b/net/nic/nic_mac/hikp_nic_mac_dump.c
index 6e856a8..3e818cd 100644
--- a/net/nic/nic_mac/hikp_nic_mac_dump.c
+++ b/net/nic/nic_mac/hikp_nic_mac_dump.c
@@ -64,6 +64,11 @@ static int mac_cmd_dump_mod(struct major_cmd_ctrl *self, const char *name,
 	uint32_t i;
 	int ret;
 
+	if (blk_num == 0) {
+		printf("%s module is not support dump.\n", name);
+		return 0;
+	}
+
 	printf("============ %10s REG INFO ==============\n", name);
 	printf("\t %s  :\t%10s\n", "offset", "value");
 
diff --git a/tool_lib/tool_lib.h b/tool_lib/tool_lib.h
index bf37465..9766a7e 100644
--- a/tool_lib/tool_lib.h
+++ b/tool_lib/tool_lib.h
@@ -18,7 +18,7 @@
 
 #define TOOL_NAME "hikptool"
 
-#define TOOL_VER "1.0.13"
+#define TOOL_VER "1.0.14"
 
 #define HI_GET_BITFIELD(value, start, mask) (((value) >> (start)) & (mask))
 #define HI_SET_FIELD(origin, shift, val)	((origin) |= (val) << (shift))
-- 
2.25.1

