From: hanyu001@208suo.com
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Fwd: [PATCH] scsi: Convert snprintf to scnprintf
Date: Mon, 17 Jul 2023 10:32:59 +0800 [thread overview]
Message-ID: <0130702c160ac0e88f3fd3e2ef02dfbc@208suo.com> (raw)
In-Reply-To: <tencent_1B9669556AF9CF690462AB7F2A47C7378809@qq.com>
Fix the coccicheck warnings:
./drivers/scsi/scsi_transport_sas.c:525:9-17: WARNING: use scnprintf or
sprintf
./drivers/scsi/scsi_transport_sas.c:572:8-16: WARNING: use scnprintf or
sprintf
./drivers/scsi/scsi_transport_sas.c:1180:9-17: WARNING: use scnprintf or
sprintf
Signed-off-by: ztt <1549089851@qq.com>
---
drivers/scsi/scsi_transport_sas.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_transport_sas.c
b/drivers/scsi/scsi_transport_sas.c
index d704c484a251..bbbe6ff28b34 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -522,7 +522,7 @@ show_sas_device_type(struct device *dev,
struct sas_phy *phy = transport_class_to_phy(dev);
if (!phy->identify.device_type)
- return snprintf(buf, 20, "none\n");
+ return scnprintf(buf, 20, "none\n");
return get_sas_device_type_names(phy->identify.device_type, buf);
}
static DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL);
@@ -569,7 +569,7 @@ show_sas_phy_enable(struct device *dev, struct
device_attribute *attr,
{
struct sas_phy *phy = transport_class_to_phy(dev);
- return snprintf(buf, 20, "%d\n", phy->enabled);
+ return scnprintf(buf, 20, "%d\n", phy->enabled);
}
static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
@@ -1177,7 +1177,7 @@ show_sas_rphy_device_type(struct device *dev,
struct sas_rphy *rphy = transport_class_to_rphy(dev);
if (!rphy->identify.device_type)
- return snprintf(buf, 20, "none\n");
+ return scnprintf(buf, 20, "none\n");
return get_sas_device_type_names(
rphy->identify.device_type, buf);
}
next parent reply other threads:[~2023-07-17 2:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tencent_1B9669556AF9CF690462AB7F2A47C7378809@qq.com>
2023-07-17 2:32 ` hanyu001 [this message]
[not found] <tencent_D9472259DA98DAF6732781816A8DCAACF107@qq.com>
2023-07-17 2:43 ` Fwd: [PATCH] scsi: Convert snprintf to scnprintf hanyu001
[not found] <tencent_3FC1F30F01ADEAF1CAC67170222ADA97DA07@qq.com>
2023-07-17 3:03 ` hanyu001
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=0130702c160ac0e88f3fd3e2ef02dfbc@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 \
/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