diff options
author | Lee Jones <[email protected]> | 2023-11-30 10:54:35 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2023-12-04 22:25:16 +0900 |
commit | 36d8aef52d0562b5b1dc2e54d0fad1dee07182c2 (patch) | |
tree | 20a3d82d8efbb0deac90a1870f59ac5b3a7221d9 /drivers/usb/cdns3/cdnsp-debug.h | |
parent | e2e2aacf042f52854c92775b7800ba668e0bdfe4 (diff) |
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 <[email protected]>
Cc: Stanislaw Gruszka <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Damien Bergamini <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdnsp-debug.h')
0 files changed, 0 insertions, 0 deletions