diff mbox series

[33/42] drivers/scsi/pcmcia/sym53c500_cs: Convert snprintf to sysfs_emit

Message ID 20240116045151.3940401-31-lizhijian@fujitsu.com
State New
Headers show
Series Fix coccicheck warnings | expand

Commit Message

Zhijian Li (Fujitsu) Jan. 16, 2024, 4:51 a.m. UTC
Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

> ./drivers/scsi/pcmcia/sym53c500_cs.c:627:8-16: WARNING: please use sysfs_emit

No functional change intended

CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: linux-scsi@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 drivers/scsi/pcmcia/sym53c500_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 278c78d066c4..264eeb24b811 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -624,7 +624,7 @@  SYM53C500_show_pio(struct device *dev, struct device_attribute *attr,
 	struct sym53c500_data *data =
 	    (struct sym53c500_data *)SHp->hostdata;
 
-	return snprintf(buf, 4, "%d\n", data->fast_pio);
+	return sysfs_emit(buf, "%d\n", data->fast_pio);
 }
 
 static ssize_t