net: hns3: fix a -Wformat-nonliteral compile warning
authorYonglong Liu <liuyonglong@huawei.com>
Fri, 28 Jun 2019 11:50:11 +0000 (19:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:31 +0000 (07:28 +0200)
commitbf55af0a275f4b16c6de7bb02855218cea4b68e9
tree512daf5e29b44765bafda091cad52c137f64b1b0
parentd53189f8e224cd215f2bf47e6c0baed0ccdeeeda
net: hns3: fix a -Wformat-nonliteral compile warning

[ Upstream commit 18d219b783da61a6cc77581f55fc4af2fa16bc36 ]

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: 46a3df9f9718 ("Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c