diff mbox series

[rdma-core,4/7] libhns: Fix wrong print format for unsigned type

Message ID 20211109124103.54326-5-liangwenpeng@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series libhns: Cleanup about removing redundant code and cleaning up static alarms | expand

Commit Message

Wenpeng Liang Nov. 9, 2021, 12:41 p.m. UTC
From: Xinhao Liu <liuxinhao5@hisilicon.com>

Change %d printf fortmat to %u for unsigned int variant.

Signed-off-by: Xinhao Liu <liuxinhao5@hisilicon.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
 providers/hns/hns_roce_u_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
index 382d2bd7..c0069b8b 100644
--- a/providers/hns/hns_roce_u_verbs.c
+++ b/providers/hns/hns_roce_u_verbs.c
@@ -73,7 +73,7 @@  int hns_roce_u_query_device(struct ibv_context *context,
 	sub_minor = raw_fw_ver & 0xffff;
 
 	snprintf(attr->orig_attr.fw_ver, sizeof(attr->orig_attr.fw_ver),
-		 "%d.%d.%03d", major, minor, sub_minor);
+		 "%u.%u.%03u", major, minor, sub_minor);
 
 	return 0;
 }