From: Li Zhijian Date: Tue, 16 Jan 2024 04:51:36 +0000 (+0800) Subject: scsi: isci: Convert snprintf() to sysfs_emit() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5fbf37e53091057fc53f1046ded8a967464c2ecf;p=linux.git scsi: isci: Convert snprintf() to sysfs_emit() 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/isci/init.c:140:8-16: WARNING: please use sysfs_emit No functional change intended CC: Artur Paszkiewicz CC: James E.J. Bottomley CC: Martin K. Petersen CC: linux-scsi@vger.kernel.org Signed-off-by: Li Zhijian Link: https://lore.kernel.org/r/20240116045151.3940401-25-lizhijian@fujitsu.com Reviewed-by: Artur Paszkiewicz Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 6277162a028bb..c582a3932ceab 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -137,7 +137,7 @@ static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, c struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); struct isci_host *ihost = container_of(sas_ha, typeof(*ihost), sas_ha); - return snprintf(buf, PAGE_SIZE, "%d\n", ihost->id); + return sysfs_emit(buf, "%d\n", ihost->id); } static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);