diff options
| author | Krzysztof Wilczyński <kw@linux.com> | 2021-06-03 00:01:07 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-06-03 22:14:47 -0500 |
| commit | f8cf6e513ec4f0e207f56c27d5030da429ac2cae (patch) | |
| tree | 592376a232b5d001e9a1858d8ce3125f644dd35e /drivers/pci/pci.c | |
| parent | 316ae33051215f92c72fe13bc1bfc4e513a26700 (diff) | |
| download | linux-f8cf6e513ec4f0e207f56c27d5030da429ac2cae.tar.gz linux-f8cf6e513ec4f0e207f56c27d5030da429ac2cae.tar.bz2 linux-f8cf6e513ec4f0e207f56c27d5030da429ac2cae.zip | |
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>
Diffstat (limited to 'drivers/pci/pci.c')
| -rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b717680377a9..5ed316ea5831 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -6439,7 +6439,7 @@ static ssize_t resource_alignment_show(struct bus_type *bus, char *buf) spin_lock(&resource_alignment_lock); if (resource_alignment_param) - count = scnprintf(buf, PAGE_SIZE, "%s", resource_alignment_param); + count = sysfs_emit(buf, "%s", resource_alignment_param); spin_unlock(&resource_alignment_lock); /* |
