linux/drivers/usb/atm
Lee Jones 36d8aef52d usb: atm: Remove snprintf() from sysfs call-backs and replace with sysfs_emit()
Since snprintf() has the documented, but still rather strange trait of
returning the length of the data that *would have been* written to the
array if space were available, rather than the arguably more useful
length of data *actually* written, it is usually considered wise to use
something else instead in order to avoid confusion.

In the case of sysfs call-backs, new wrappers exist that do just that.

This patch replaces the 2 uses of snprintf() found in the sysfs .show()
call-backs with the new sysfs_emit() helpers.  Whist we're at it, let's
replace the sprintf()s as well.  For no other reason than consistency.

Link: https://lwn.net/Articles/69419/
Link: https://github.com/KSPP/linux/issues/105
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Damien Bergamini <damien.bergamini@free.fr>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20231130105459.3208986-2-lee@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-04 22:25:16 +09:00
..
cxacru.c usb: atm: cxacru: Fix typo in comment 2021-05-21 20:05:40 +02:00
Kconfig usb: remove redundant 'default n' from Kconfig-s 2019-05-21 10:06:22 +02:00
Makefile
speedtch.c
ueagle-atm.c usb: atm: Remove snprintf() from sysfs call-backs and replace with sysfs_emit() 2023-12-04 22:25:16 +09:00
usbatm.c usb: atm: Use size_add() in call to struct_size() 2023-10-02 09:48:51 -07:00
usbatm.h USB: atm: Use the correct style for SPDX License Identifier 2020-03-17 20:03:28 +01:00
xusbatm.c drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk() 2020-12-09 15:22:51 +01:00