[<prev] [next>] [day] [month] [year] [list]
Message-ID: <716c3cdc.1d2.184b9159597.Coremail.wangkailong@jari.cn>
Date: Sun, 27 Nov 2022 20:35:10 +0800 (GMT+08:00)
From: "KaiLong Wang" <wangkailong@...i.cn>
To: kartilak@...co.com, sebaddel@...co.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: snic: convert sysfs snprintf to sysfs_emit
Fix the following coccicheck warning:
drivers/scsi/snic/snic_attrs.c:26:8-16: WARNING: use scnprintf or
sprintf
drivers/scsi/snic/snic_attrs.c:16:8-16: WARNING: use scnprintf or
sprintf
drivers/scsi/snic/snic_attrs.c:35:8-16: WARNING: use scnprintf or
sprintf
drivers/scsi/snic/snic_attrs.c:48:8-16: WARNING: use scnprintf or
sprintf
Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
---
drivers/scsi/snic/snic_attrs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/snic/snic_attrs.c b/drivers/scsi/snic/snic_attrs.c
index 3ddbdbc3ded1..6e8f4d0b9c3c 100644
--- a/drivers/scsi/snic/snic_attrs.c
+++ b/drivers/scsi/snic/snic_attrs.c
@@ -13,7 +13,7 @@ snic_show_sym_name(struct device *dev,
{
struct snic *snic = shost_priv(class_to_shost(dev));
- return snprintf(buf, PAGE_SIZE, "%s\n", snic->name);
+ return sysfs_emit(buf, "%s\n", snic->name);
}
static ssize_t
@@ -23,7 +23,7 @@ snic_show_state(struct device *dev,
{
struct snic *snic = shost_priv(class_to_shost(dev));
- return snprintf(buf, PAGE_SIZE, "%s\n",
+ return sysfs_emit(buf, "%s\n",
snic_state_str[snic_get_state(snic)]);
}
@@ -32,7 +32,7 @@ snic_show_drv_version(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%s\n", SNIC_DRV_VERSION);
+ return sysfs_emit(buf, "%s\n", SNIC_DRV_VERSION);
}
static ssize_t
@@ -45,7 +45,7 @@ snic_show_link_state(struct device *dev,
if (snic->config.xpt_type == SNIC_DAS)
snic->link_status = svnic_dev_link_status(snic->vdev);
- return snprintf(buf, PAGE_SIZE, "%s\n",
+ return sysfs_emit(buf, "%s\n",
(snic->link_status) ? "Link Up" : "Link Down");
}
--
2.25.1
Powered by blists - more mailing lists