]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: replace snprintf with scnprintf in hns3_update_strings
authorChen Zhou <chenzhou10@huawei.com>
Mon, 20 Jan 2020 12:50:33 +0000 (20:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jan 2020 09:48:40 +0000 (10:48 +0100)
commitab6425512e762567126823a588d1ba8204ba2a64
tree3c4b8f4d0e7cadc32b8127bd8b062854dfdf7181
parent7e8e9ad7907d21de113dc402e9a75c303ed3e00b
net: hns3: replace snprintf with scnprintf in hns3_update_strings

snprintf returns the number of bytes that would be written, which may be
greater than the the actual length to be written. Here use extra code to
handle this.

scnprintf returns the number of bytes that was actually written, just use
scnprintf to simplify the code.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c