PCI: Replace use of snprintf() with scnprintf() in show() functions
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | PCI: Replace use of snprintf() with scnprintf() in resource_alignment_show()drivers/ | +1 | 0 replies | |
| 2/3 | PCI: sysfs: Replace use of snprintf() with scnprintf() in driver_override_show()drivers/ | +1 | 0 replies | |
| 3/3 | PCI/P2PDMA: Replace use of snprintf() with scnprintf() in show() functionsdrivers/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] PCI: Replace use of snprintf() with scnprintf() in show() functions
Replace use of snprintf() with scnprintf() in order to adhere to the rules in Documentation/filesystems/sysfs.txt, as per:
show() must not use snprintf() when formatting the value to be returned to user space. If you can guarantee that an overflow will never happen you can use sprintf() otherwise you must use scnprintf().
Also resolve the following Coccinelle warnings, for example:
drivers/pci/p2pdma.c:69:8-16: WARNING: use scnprintf or sprintf drivers/pci/p2pdma.c:78:8-16: WARNING: use scnprintf or sprintf drivers/pci/p2pdma.c:56:8-16: WARNING: use scnprintf or sprintf
The Coccinelle warning was added in commit abfc19ff202d ("coccinelle:
api: add device_attr_show script").
There is no change to the functionality.
Related:
https://patchwork.kernel.org/patch/9946759/#20969333
https://lwn.net/Articles/69419
Krzysztof Wilczyński (3):
PCI: Replace use of snprintf() with scnprintf() in
resource_alignment_show()
PCI: sysfs: Replace use of snprintf() with scnprintf() in
driver_override_show()
PCI/P2PDMA: Replace use of snprintf() with scnprintf() in show()
functions
drivers/pci/p2pdma.c | 8 ++++---- drivers/pci/pci-sysfs.c | 2 +- drivers/pci/pci.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.28.0