Commit 18d219b7 authored by Yonglong Liu's avatar Yonglong Liu Committed by David S. Miller

net: hns3: fix a -Wformat-nonliteral compile warning

When setting -Wformat=2, there is a compiler warning like this:

hclge_main.c:xxx:x: warning: format not a string literal and no
format arguments [-Wformat-nonliteral]
strs[i].desc);
^~~~

This patch adds missing format parameter "%s" to snprintf() to
fix it.

Fixes: 46a3df9f ("Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04f25edb
...@@ -564,8 +564,7 @@ static u8 *hclge_comm_get_strings(u32 stringset, ...@@ -564,8 +564,7 @@ static u8 *hclge_comm_get_strings(u32 stringset,
return buff; return buff;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
snprintf(buff, ETH_GSTRING_LEN, snprintf(buff, ETH_GSTRING_LEN, "%s", strs[i].desc);
strs[i].desc);
buff = buff + ETH_GSTRING_LEN; buff = buff + ETH_GSTRING_LEN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment