[PATCH] scsi: fcoe: add a newline when printing 'fcoe_transport' by sysfs
From: Xiongfeng Wang
Date: Mon May 11 2020 - 07:46:52 EST
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@xxxxxxxxxx>
---
drivers/scsi/fcoe/fcoe_transport.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
}
--
1.7.12.4