diff options
author | Qianqian Xie <xieqianqian@huawei.com> | 2016-03-24 14:08:01 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-24 21:33:06 +0300 |
commit | 8d71397bd2021f8ef68ae34d8bea431cc903fcdd (patch) | |
tree | c898428bf93edd8806d7c1735b8d5a2c2a2a9a78 /drivers/net/ethernet | |
parent | 526131262223e9315bfd41213f5a76e792f184ff (diff) | |
download | linux-8d71397bd2021f8ef68ae34d8bea431cc903fcdd.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c index 6e2b76ede075..44abb08de155 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c @@ -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; } } |