s390/cio: convert sprintf()/snprintf() to sysfs_emit()
authorLi Zhijian <lizhijian@fujitsu.com>
Thu, 14 Mar 2024 09:52:09 +0000 (17:52 +0800)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Tue, 9 Apr 2024 15:29:56 +0000 (17:29 +0200)
commitaaebea959efb2cccd870990f1b6016ff324b0fb6
tree9c31f780c63547b3b6e16306f8cbea86bd948254
parentb3840c8bfc27c1e8dc3953d6a27960ae390d5d80
s390/cio: convert sprintf()/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().

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: Vineeth Vijayan <vneethv@linux.ibm.com>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Link: https://lore.kernel.org/r/20240314095209.1325229-1-lizhijian@fujitsu.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
drivers/s390/cio/css.c