[PATCH 32/42] drivers/scsi/ncr53c8xx: Convert snprintf to sysfs_emit
From: Li Zhijian
Date: Tue Jan 16 2024 - 00:06:21 EST
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/ncr53c8xx.c:8034:8-16: WARNING: please use sysfs_emit
No functional change intended
CC: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxx>
CC: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
CC: linux-scsi@xxxxxxxxxxxxxxx
Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxx>
---
drivers/scsi/ncr53c8xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 35869b4f9329..2bd74620caf5 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -8031,7 +8031,7 @@ static ssize_t show_ncr53c8xx_revision(struct device *dev,
struct Scsi_Host *host = class_to_shost(dev);
struct host_data *host_data = (struct host_data *)host->hostdata;
- return snprintf(buf, 20, "0x%x\n", host_data->ncb->revision_id);
+ return sysfs_emit(buf, "0x%x\n", host_data->ncb->revision_id);
}
static struct device_attribute ncr53c8xx_revision_attr = {
--
2.29.2