Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1804410ybk; Mon, 11 May 2020 04:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5rXxRkawfhvKV6awsMPAIxIfKb+nyVg/gl4o+njmYhW/t//qqwdJDZTCAEpIZmVJ++/B0 X-Received: by 2002:a50:fc06:: with SMTP id i6mr1632194edr.40.1589197736700; Mon, 11 May 2020 04:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589197736; cv=none; d=google.com; s=arc-20160816; b=M+ohjgliNRde5c47Gz2KApQ7H0NOdNctXtFu6YGx5OYdXbyaxf8RveIjQFGJIT3FbR h3hMzb/MX1eWGNZiDC2CdHgia7ogLVsKWhgx26vCydgwzb7CSO/2XvV+IY8abqxuPCJK SyTDA9/Jo8KLxTelJ660uyj5IcQglCRhH+JvnYq8VuiLQwLW0TEzQJIKFVCaXzaWRYub LWOeObTHUK4Jo0TzLJdSgu9UkwmyIJZi3Q5EEss+VxWfoLSHaViSWeFiaP2UqgRFSFWI OQglpSMJa/QtX004/nUin8ixjuEjsBDZ/NoaJNcRRtCyqu+35AzpHICmIUxUyhnOsZju AQzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=/DEjKs9Kzx1KiG1m5kDX5Bz9YgpQ322JPZ/vTG38Wd4=; b=YXS3uoiyz4lehdG0vQBA5vdov2DS+z11G1c32uudzoOxcMjomVFW/Ec3QWexp65b1c qBzhpf13mubwx6TRkB6svOh7WF+AdXsmMEfx6T12/+StjXw7pgiNdrq3rfEaOu+FU0wC I+aYUSjyf6wCQBgaMsB9Evldqe2R/+1fMj9P7kUlbzoAvZpB9vKIuarNUFBdfZORzX44 sEolJznkzqOV3dg8h7wl7p44Gxix5ewWB6CbllKSqJWFL07gDVrRBjNwRegDLZOLDhR+ Gl44QJdGOaERSBAIWyhwj5lcbkQT6tXAH7xBlw8tWOlMf9VGcVbykQsrx+tcDRLNnROW qyhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si3783475edj.251.2020.05.11.04.48.33; Mon, 11 May 2020 04:48:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729610AbgEKLqv (ORCPT + 99 others); Mon, 11 May 2020 07:46:51 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4329 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726068AbgEKLqv (ORCPT ); Mon, 11 May 2020 07:46:51 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 15DC253A6DB7E3CFC730; Mon, 11 May 2020 19:46:48 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 11 May 2020 19:46:40 +0800 From: Xiongfeng Wang To: , , CC: , , Subject: [PATCH] scsi: fcoe: add a newline when printing 'fcoe_transport' by sysfs Date: Mon, 11 May 2020 19:40:40 +0800 Message-ID: <1589197240-28118-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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