]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net-sysfs: add a newline when printing 'tx_timeout' by sysfs
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Tue, 21 Jul 2020 07:02:57 +0000 (15:02 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
BugLink: https://bugs.launchpad.net/bugs/1890343
[ Upstream commit 9bb5fbea59f36a589ef886292549ca4052fe676c ]

When I cat 'tx_timeout' by sysfs, it displays as follows. It's better to
add a newline for easy reading.

root@syzkaller:~# cat /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
0root@syzkaller:~#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/core/net-sysfs.c

index cf0215734ceb07089b60911a269a53bc2f0f1913..603f74a56cee2bb3c62eb15891f3b705564434ae 100644 (file)
@@ -1077,7 +1077,7 @@ static ssize_t tx_timeout_show(struct netdev_queue *queue, char *buf)
        trans_timeout = queue->trans_timeout;
        spin_unlock_irq(&queue->_xmit_lock);
 
-       return sprintf(buf, "%lu", trans_timeout);
+       return sprintf(buf, fmt_ulong, trans_timeout);
 }
 
 static unsigned int get_netdev_queue_index(struct netdev_queue *queue)