Message ID | 1589197240-28118-1-git-send-email-wangxiongfeng2@huawei.com (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
Series | scsi: fcoe: add a newline when printing 'fcoe_transport' by sysfs | expand |
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index a20ddc3..1b82753 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c @@ -607,7 +607,10 @@ static int fcoe_transport_show(char *buffer, const struct kernel_param *kp) } mutex_unlock(&ft_mutex); if (i == j) - i += snprintf(&buffer[i], IFNAMSIZ, "none"); + i += snprintf(&buffer[i], IFNAMSIZ, "none\n"); + else if (PAGE_SIZE - i >= 1) + i += sprintf(&buffer[i], "\n"); + return i; }
When I print 'fcoe_transport' by sysfs, it displays as follows. It is better to add a newline for easy reading. [root@hulk-202 ~]# cat /sys/module/libfcoe/parameters/show Attached FCoE transports:fcoe [root@hulk-202 ~]# Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> --- drivers/scsi/fcoe/fcoe_transport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)