OSDN Git Service

usb: atm: don't use snprintf() for sysfs attrs
authorAlex Dewar <alex.dewar90@gmail.com>
Mon, 24 Aug 2020 22:23:20 +0000 (23:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Aug 2020 17:11:18 +0000 (19:11 +0200)
commitcb06b385d5361217764543a1dec746955a094d0b
tree22d62a1b770263979a1d2630256c5feae3b3fe02
parent28157b8c7d9a9c92d1da31af486fe4ad39862edd
usb: atm: don't use snprintf() for sysfs attrs

kernel/cpu.c: don't use snprintf() for sysfs attrs

As per the documentation (Documentation/filesystems/sysfs.rst),
snprintf() should not be used for formatting values returned by sysfs.

In all of these cases, sprintf() suffices as we know that the formatted
strings will be less than PAGE_SIZE in length.

Issue identified by Coccinelle.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200824222322.22962-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/atm/cxacru.c