2020-05-11 11:48:56

by Xiongfeng Wang

[permalink] [raw]
Subject: [PATCH] scsi: fcoe: add a newline when printing 'fcoe_transport' by sysfs

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 <[email protected]>
---
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