mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 00:40:55 +07:00
net: hns: optimizate fmt of snprintf()
It misses string format in function snprintf(), as below: snprintf(buff, ETH_GSTRING_LEN, g_gmac_stats_string[i].desc); It needs to add "%s" to fix it as below: snprintf(buff, ETH_GSTRING_LEN, "%s", g_gmac_stats_string[i].desc); Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5261312622
commit
8d71397bd2
@ -664,7 +664,8 @@ static void hns_gmac_get_strings(u32 stringset, u8 *data)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(g_gmac_stats_string); i++) {
|
||||
snprintf(buff, ETH_GSTRING_LEN, g_gmac_stats_string[i].desc);
|
||||
snprintf(buff, ETH_GSTRING_LEN, "%s",
|
||||
g_gmac_stats_string[i].desc);
|
||||
buff = buff + ETH_GSTRING_LEN;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user