aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/generic.c
diff options
context:
space:
mode:
authorLee Jones <[email protected]>2023-11-30 10:54:39 +0000
committerGreg Kroah-Hartman <[email protected]>2023-12-04 13:25:17 +0000
commitdadc0f0f7afc0273ff680b504ed830d0c307dea3 (patch)
treec3750aec4c190eda3c651159e638d5651faba557 /drivers/usb/core/generic.c
parentusb: gadget: Remove snprintf() from sysfs call-backs and replace with sysfs_e... (diff)
downloadkernel-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