Skip to content

Commit 5fbf37e

Browse files
zhijianli88martinkpetersen
authored andcommitted
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 <artur.paszkiewicz@intel.com> CC: James E.J. Bottomley <jejb@linux.ibm.com> CC: Martin K. Petersen <martin.petersen@oracle.com> CC: linux-scsi@vger.kernel.org Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Link: https://lore.kernel.org/r/20240116045151.3940401-25-lizhijian@fujitsu.com Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 01105c2 commit 5fbf37e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/isci/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, c
137137
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
138138
struct isci_host *ihost = container_of(sas_ha, typeof(*ihost), sas_ha);
139139

140-
return snprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
140+
return sysfs_emit(buf, "%d\n", ihost->id);
141141
}
142142

143143
static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);

0 commit comments

Comments
 (0)