PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions
authorKrzysztof Wilczyński <kw@linux.com>
Fri, 16 Apr 2021 20:58:45 +0000 (20:58 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Apr 2021 15:07:31 +0000 (10:07 -0500)
commitad025f8e46f3dbf09b1bf8d7a5b4ce858df74544
tree6b5d6eb50ec384be36c16e08f30f6d2f790124aa
parentdf1af7cbe7bc11720b3e915771d47acc3604eb44
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

[bhelgaas: drop dsm_label_utf16s_to_utf8s(), link speed/width changes]
Link: https://lore.kernel.org/r/20210416205856.3234481-10-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-label.c
drivers/pci/pci-sysfs.c