From patchwork Sun Nov 27 12:44:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 26351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5099924wrr; Sun, 27 Nov 2022 04:59:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zmrBxQGvR5Y/fjyCgosCYhKhX4iesEO/NUJtnlc8Cu7dZCEorHdRw/vs9flviVBkOiWxo X-Received: by 2002:aa7:83d3:0:b0:56e:8477:1add with SMTP id j19-20020aa783d3000000b0056e84771addmr36433896pfn.13.1669553983032; Sun, 27 Nov 2022 04:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669553983; cv=none; d=google.com; s=arc-20160816; b=C+cZErUEBFAL1LhEz1aj2mF/8dhC78oDtcjY7CXjAIYzrlj06Jb2vdmQtJt/1TkubF cbDy6A4J9U7prv88rNZEFfntYkBzOM0GEiyS7c1Z9N59PjeVxayxEihQORBfw397A9zg k7tAlZGViWR9MkxWLKGVs/3NN2ksUm6XNolqaZqBlBCM6JaXdAIFhlIQE2hXxkE+aFnK 8/IjyrQVwiu6NrpGMPUM+8oeLb5EHjtSUOSBxCL8E0xZy/VnlELE6VkugYqlD5xyKXPL IfexLVbBlOOWixZRUrHz+cs8doc3S+2DAtRpQNz2dv4uMh1XHw1CplEUTI7MKXeOo1K2 kjjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=452VT0d4flkoVc+VtKCdHQLhiK4sTvB602ykDsN379E=; b=pg+lPSzVW70XFn19OZ37HdH5fyNQMKPyc6qTJcxFgygmlZdc0AG1i9p5k11oOIvuQK fjiccSGm02Rpzhez1IUMe7sctDQ/F0CmP8NespS3v0s2t3wvalBaxcohaGcze/wN1KbP SYaNbR6KUhfjc8/0qKV7NUKb67o5oZqaUeZQ8ZJQz4YCy7ckNkUJ5xglSBe/oay9CEH5 dPpEd3OZaPZTY5piq0dhiU9RIYXlkFzmXjVUcpjSsPYDfAiviDv0GNF/9TDv2Et6c4jD hqmweoYS82EMi88fnlx8oDl94v99sh+QWvyhVBB12JRL8/rf9FWapGUmX2VeDevyr+fE Fd7A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj5-20020a170902850500b001865dfb6774si1439063plb.458.2022.11.27.04.59.29; Sun, 27 Nov 2022 04:59:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiK0Mo0 (ORCPT + 99 others); Sun, 27 Nov 2022 07:44:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiK0MoZ (ORCPT ); Sun, 27 Nov 2022 07:44:25 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6335BCB7; Sun, 27 Nov 2022 04:44:23 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 27 Nov 2022 20:44:13 +0800 (GMT+08:00) X-Originating-IP: [182.148.15.36] Date: Sun, 27 Nov 2022 20:44:13 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: mikecyr@linux.ibm.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: ibmvscsi_tgt: convert sysfs snprintf to sysfs_emit X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <483482fb.1d3.184b91dde72.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCHj+CdW4NjZHIFAA--.115W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQADB2FEYx0G1gACsM X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750654237412671085?= X-GMAIL-MSGID: =?utf-8?q?1750654237412671085?= Fix the following coccicheck warning: drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3625:8-16: WARNING: use scnprintf or sprintf drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3619:8-16: WARNING: use scnprintf or sprintf drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3633:8-16: WARNING: use scnprintf or sprintf Signed-off-by: KaiLong Wang Reviewed-by: Chaitanya Kulkarni --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index e8770310a64b..d9a615306949 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3616,13 +3616,13 @@ static void ibmvscsis_remove(struct vio_dev *vdev) static ssize_t system_id_show(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%s\n", system_id); + return sysfs_emit(buf, "%s\n", system_id); } static ssize_t partition_number_show(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%x\n", partition_number); + return sysfs_emit(buf, "%x\n", partition_number); } static ssize_t unit_address_show(struct device *dev, @@ -3630,7 +3630,7 @@ static ssize_t unit_address_show(struct device *dev, { struct scsi_info *vscsi = container_of(dev, struct scsi_info, dev); - return snprintf(buf, PAGE_SIZE, "%x\n", vscsi->dma_dev->unit_address); + return sysfs_emit(buf, "%x\n", vscsi->dma_dev->unit_address); } static int ibmvscsis_get_system_info(void)