]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
HID: hid-picolcd*: Convert sprintf() family to sysfs_emit() family
authorLi Zhijian <lizhijian@fujitsu.com>
Tue, 19 Mar 2024 05:45:24 +0000 (13:45 +0800)
committerJiri Kosina <jkosina@suse.com>
Wed, 3 Apr 2024 11:42:04 +0000 (13:42 +0200)
commit247481b893e34805bfd94fdc34a34faa3bdec2de
treeb7fcc15ccc569bafc9dd594762409415aec6e151
parent3e78a6c0d3e02e4cf881dc84c5127e9990f939d6
HID: hid-picolcd*: 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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
CC: "Bruno Prémont" <bonbons@linux-vserver.org>
CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-picolcd_core.c
drivers/hid/hid-picolcd_fb.c