scsi: snic: Convert sprintf() family to sysfs_emit() family
authorLi Zhijian <lizhijian@fujitsu.com>
Tue, 19 Mar 2024 06:31:19 +0000 (14:31 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Apr 2024 02:04:32 +0000 (22:04 -0400)
commiteab302e89f3d736715bae94d032a20b2a6f5403e
treeab321a0f3ee9bc1ba4c4a9763f36d06a040e04c7
parent9bd8e41358a52ff2be312a0ab7bd6426ba4c6fe3
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: Li Zhijian <lizhijian@fujitsu.com>
Link: https://lore.kernel.org/r/20240319063132.1588443-12-lizhijian@fujitsu.com
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/snic/snic_attrs.c