Skip to content
Commit eab302e8 authored by Li Zhijian's avatar Li Zhijian Committed by Martin K. Petersen
Browse files

scsi: snic: Convert sprintf() family to sysfs_emit() family



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().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Karan Tilak Kumar <kartilak@cisco.com>
CC: Sesidhar Baddela <sebaddel@cisco.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: default avatarLi Zhijian <lizhijian@fujitsu.com>
Link: https://lore.kernel.org/r/20240319063132.1588443-12-lizhijian@fujitsu.com
Reviewed-by: default avatarKaran Tilak Kumar <kartilak@cisco.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9bd8e413
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment