diff options
| author | Lee Jones <[email protected]> | 2023-11-30 10:54:39 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-12-04 13:25:17 +0000 |
| commit | dadc0f0f7afc0273ff680b504ed830d0c307dea3 (patch) | |
| tree | c3750aec4c190eda3c651159e638d5651faba557 /drivers/usb/core/generic.c | |
| parent | usb: gadget: Remove snprintf() from sysfs call-backs and replace with sysfs_e... (diff) | |
| download | kernel-dadc0f0f7afc0273ff680b504ed830d0c307dea3.tar.gz kernel-dadc0f0f7afc0273ff680b504ed830d0c307dea3.zip | |
usb: gadget: f_tcm: 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 just one use of snprintf() found in the sysfs
.show() call-back with the new sysfs_emit() helper.
Link: https://lwn.net/Articles/69419/
Link: https://github.com/KSPP/linux/issues/105
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Dmitry Bogdanov <[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/core/generic.c')
0 files changed, 0 insertions, 0 deletions
