Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp571816rwb; Thu, 10 Nov 2022 04:55:45 -0800 (PST) X-Google-Smtp-Source: AMsMyM7x08vfSlO1BFNsRiYtOr+QyNNFPTd7kznaUWMSfJFOAD9HUjKRNlkJ4t37bMNUyWPluo8Y X-Received: by 2002:a63:7e4d:0:b0:43c:8ce9:2a9f with SMTP id o13-20020a637e4d000000b0043c8ce92a9fmr54484508pgn.528.1668084945090; Thu, 10 Nov 2022 04:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668084945; cv=none; d=google.com; s=arc-20160816; b=cdoLV1Gts8flwhfdmXttudIACmRAq/yr/nzCNg9miQfuXrWzDTbV2JVavPOIoGpg/u qHWWbybQBVz0Je0l+rwyfxLKfYwQYnSs2deYCZsxcoeC7TWDu/SFdUcEIqlHZrB5oVeR 5MoINnaPQBE7OJ2IMZldmzxQW22gqx7wAEHwlUZAR4h/MG5Had7n0f8truRhdqDj1pIG +fdVOf5NZLEBAjMYig48SNW4Gn1OykzcSCHlnMjL4aak3SYmq6fiko1lLUU7IF2gyzfd Ch6nm8s8rsr2WKxF3Dh1FlkRxPuEkG2PZEpZTCxde478N3Bci8mn9p+RkjkMKZeJMcFA wDrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=LGxJt8IB/r+lZkOH48+otA/GOl8jJUXewQPTHbfyS0I=; b=bTLS1JMlxGc9lLkF1XXdh1Hg5UIzQFNq06OxzLvKYUi2PZE3ODGbkoDaSYFz26auBQ wFW9TaVa86dk3n6jf8FoIjr7/pYbdK5hn/IHS1Vnfss+3to93gCxYkgHxRp0khD0B7hC SJR+byAcvm8akiR/dW/NQbegL/NEg2XT00ou7yiZh1upfGnij/G2nP4tEMhEWbyIKdCJ 8AZfViJxbvJbaac7WKl89cgYC/gxeCVZeaznFxilHrni0qVIID4GqKBby1dmvIT7OOAU hgXim79botGeG9irohgaeaVzb0eiBV+k4cl8Uzo7grFofwND2Gp8YxAxCGpW+nnJjdKv Yckg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638b49000000b0046e9da89cebsi20878561pge.532.2022.11.10.04.55.31; Thu, 10 Nov 2022 04:55:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbiKJMk1 (ORCPT + 92 others); Thu, 10 Nov 2022 07:40:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiKJMkZ (ORCPT ); Thu, 10 Nov 2022 07:40:25 -0500 X-Greylist: delayed 354 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Nov 2022 04:40:23 PST Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E28C22516; Thu, 10 Nov 2022 04:40:23 -0800 (PST) Received: from mxde.zte.com.cn (unknown [10.35.20.121]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4N7Lr30lsFz7BlX; Thu, 10 Nov 2022 20:34:27 +0800 (CST) Received: from mxus.zte.com.cn (unknown [10.207.168.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4N7Lqn154lz9vSp3; Thu, 10 Nov 2022 20:34:13 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxus.zte.com.cn (FangMail) with ESMTPS id 4N7Lqj53HbzdmYkl; Thu, 10 Nov 2022 20:34:09 +0800 (CST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4N7Lqf3HpHz8RV7D; Thu, 10 Nov 2022 20:34:06 +0800 (CST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4N7LqZ6MvLz4y0v3; Thu, 10 Nov 2022 20:34:02 +0800 (CST) Received: from szxlzmapp03.zte.com.cn ([10.5.231.207]) by mse-fl1.zte.com.cn with SMTP id 2AACXwdd047492; Thu, 10 Nov 2022 20:33:58 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp03[null]) by mapi (Zmail) with MAPI id mid14; Thu, 10 Nov 2022 20:34:01 +0800 (CST) Date: Thu, 10 Nov 2022 20:34:01 +0800 (CST) X-Zmail-TransId: 2b05636cefb953b22096 X-Mailer: Zmail v1.0 Message-ID: <202211102034017058666@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHRdIHNjc2k6IGlibXZmYzogdXNlIHN5c2ZzX2VtaXQoKSB0byBpbnN0ZWFkIG9mIHNjbnByaW50Zigp?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AACXwdd047492 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.14.novalocal with ID 636CEFD2.000 by FangMail milter! X-FangMail-Envelope: 1668083667/4N7Lr30lsFz7BlX/636CEFD2.000/10.35.20.121/[10.35.20.121]/mxde.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 636CEFD2.000/4N7Lr30lsFz7BlX X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Panda Replace the open-code with sysfs_emit() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- drivers/scsi/ibmvscsi/ibmvfc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 1a0c0b7289d2..c412752ea140 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -3411,7 +3411,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct device *dev, struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.partition_name); } @@ -3421,7 +3421,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device *dev, struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.device_name); } @@ -3431,7 +3431,7 @@ static ssize_t ibmvfc_show_host_loc_code(struct device *dev, struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.port_loc_code); } @@ -3441,7 +3441,7 @@ static ssize_t ibmvfc_show_host_drc_name(struct device *dev, struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.drc_name); } @@ -3450,7 +3450,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct device *dev, { struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%d\n", be32_to_cpu(vhost->login_buf->resp.version)); + return sysfs_emit(buf, "%d\n", be32_to_cpu(vhost->login_buf->resp.version)); } static ssize_t ibmvfc_show_host_capabilities(struct device *dev, @@ -3458,7 +3458,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct device *dev, { struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%llx\n", be64_to_cpu(vhost->login_buf->resp.capabilities)); + return sysfs_emit(buf, "%llx\n", be64_to_cpu(vhost->login_buf->resp.capabilities)); } /** @@ -3479,7 +3479,7 @@ static ssize_t ibmvfc_show_log_level(struct device *dev, int len; spin_lock_irqsave(shost->host_lock, flags); - len = snprintf(buf, PAGE_SIZE, "%d\n", vhost->log_level); + len = sysfs_emit(buf, "%d\n", vhost->log_level); spin_unlock_irqrestore(shost->host_lock, flags); return len; } @@ -3517,7 +3517,7 @@ static ssize_t ibmvfc_show_scsi_channels(struct device *dev, int len; spin_lock_irqsave(shost->host_lock, flags); - len = snprintf(buf, PAGE_SIZE, "%d\n", vhost->client_scsi_channels); + len = sysfs_emit(buf, "%d\n", vhost->client_scsi_channels); spin_unlock_irqrestore(shost->host_lock, flags); return len; } -- 2.15.2