PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions
authorKrzysztof Wilczyński <kw@linux.com>
Thu, 3 Jun 2021 00:01:07 +0000 (00:01 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 4 Jun 2021 03:14:47 +0000 (22:14 -0500)
commitf8cf6e513ec4f0e207f56c27d5030da429ac2cae
tree592376a232b5d001e9a1858d8ce3125f644dd35e
parent316ae33051215f92c72fe13bc1bfc4e513a26700
PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions

The sysfs_emit() and sysfs_emit_at() functions were introduced to make
it less ambiguous which function is preferred when writing to the output
buffer in a device attribute's "show" callback [1].

Convert the PCI sysfs object "show" functions from sprintf(), snprintf()
and scnprintf() to sysfs_emit() and sysfs_emit_at() accordingly, as the
latter is aware of the PAGE_SIZE buffer and correctly returns the number
of bytes written into the buffer.

No functional change intended.

[1] Documentation/filesystems/sysfs.rst

Related commit: ad025f8e46f3 ("PCI/sysfs: Use sysfs_emit() and
sysfs_emit_at() in "show" functions").

Link: https://lore.kernel.org/r/20210603000112.703037-2-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
12 files changed:
drivers/pci/hotplug/pci_hotplug_core.c
drivers/pci/hotplug/rpadlpar_sysfs.c
drivers/pci/hotplug/shpchp_sysfs.c
drivers/pci/iov.c
drivers/pci/msi.c
drivers/pci/p2pdma.c
drivers/pci/pci-label.c
drivers/pci/pci.c
drivers/pci/pcie/aer.c
drivers/pci/pcie/aspm.c
drivers/pci/slot.c
drivers/pci/switch/switchtec.c