From: hanyu001@208suo.com
To: 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: Fwd: [PATCH] scsi: ibmvscsi_tgt: Convert snprintf() to sysfs_emit()
Date: Thu, 13 Jul 2023 15:04:46 +0800 [thread overview]
Message-ID: <0969a39dca88032a93ce9c619e707d7d@208suo.com> (raw)
In-Reply-To: <tencent_9B65D1CAD7CE9FE3086C542B55428F8B110A@qq.com>
Coccinnelle reports a warning
Warning: Use scnprintf or sprintf
WARNING: use scnprintf or sprintf
WARNING: use scnprintf or sprintf
WARNING: use scnprintf or sprintf
Signed-off-by: ztt <1549089851@qq.com>
---
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 385f812b8793..f9dad598380d 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 scnprintf(buf, PAGE_SIZE, "%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 scnprintf(buf, PAGE_SIZE, "%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 scnprintf(buf, PAGE_SIZE, "%x\n",
vscsi->dma_dev->unit_address);
}
static int ibmvscsis_get_system_info(void)
parent reply other threads:[~2023-07-13 7:04 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <tencent_9B65D1CAD7CE9FE3086C542B55428F8B110A@qq.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0969a39dca88032a93ce9c619e707d7d@208suo.com \
--to=hanyu001@208suo.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox