All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net-sysfs: add a newline when printing 'tx_timeout' by sysfs
@ 2020-07-20 11:17 Xiongfeng Wang
  2020-07-21  0:44 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Xiongfeng Wang @ 2020-07-20 11:17 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, wangxiongfeng2

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>
---
 net/core/net-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index e353b82..52bafb8 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1108,7 +1108,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, "%lu\n", trans_timeout);
 }
 
 static unsigned int get_netdev_queue_index(struct netdev_queue *queue)
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net-sysfs: add a newline when printing 'tx_timeout' by sysfs
  2020-07-20 11:17 [PATCH] net-sysfs: add a newline when printing 'tx_timeout' by sysfs Xiongfeng Wang
@ 2020-07-21  0:44 ` David Miller
  2020-07-21  6:16   ` Xiongfeng Wang
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2020-07-21  0:44 UTC (permalink / raw)
  To: wangxiongfeng2; +Cc: kuba, netdev, linux-kernel

From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Date: Mon, 20 Jul 2020 19:17:49 +0800

> -	return sprintf(buf, "%lu", trans_timeout);
> +	return sprintf(buf, "%lu\n", trans_timeout);

Better to replace it with 'fmt_ulong'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net-sysfs: add a newline when printing 'tx_timeout' by sysfs
  2020-07-21  0:44 ` David Miller
@ 2020-07-21  6:16   ` Xiongfeng Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Xiongfeng Wang @ 2020-07-21  6:16 UTC (permalink / raw)
  To: David Miller; +Cc: kuba, netdev, linux-kernel

Hi,

On 2020/7/21 8:44, David Miller wrote:
> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> Date: Mon, 20 Jul 2020 19:17:49 +0800
> 
>> -	return sprintf(buf, "%lu", trans_timeout);
>> +	return sprintf(buf, "%lu\n", trans_timeout);
> 
> Better to replace it with 'fmt_ulong'.

Thanks for your advice. I will change it in the next version.

Thanks,
Xiongfeng

> 
> .
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-21  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 11:17 [PATCH] net-sysfs: add a newline when printing 'tx_timeout' by sysfs Xiongfeng Wang
2020-07-21  0:44 ` David Miller
2020-07-21  6:16   ` Xiongfeng Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.