From: Gerd Bayer Date: Mon, 30 Sep 2024 11:41:43 +0000 (+0200) Subject: s390/pci: Switch over to sysfs_emit X-Git-Tag: v6.13-rc1~206^2~122 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc7f911b033a6c33bc0c919c8d94e5f09717a2f8;p=thirdparty%2Fkernel%2Flinux.git s390/pci: Switch over to sysfs_emit Per Documentation/filesystems/sysfs.rst, sysfs_emit() is preferred over sprintf for presenting attributes to user space. Convert over two left-over uses in the s390 PCI code. Reviewed-by: Niklas Schnelle Signed-off-by: Gerd Bayer Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c index 1f81f6ff7b954..055a75b3f59d7 100644 --- a/arch/s390/pci/pci_sysfs.c +++ b/arch/s390/pci/pci_sysfs.c @@ -23,7 +23,7 @@ static ssize_t name##_show(struct device *dev, \ { \ struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); \ \ - return sprintf(buf, fmt, zdev->member); \ + return sysfs_emit(buf, fmt, zdev->member); \ } \ static DEVICE_ATTR_RO(name) @@ -45,7 +45,7 @@ static ssize_t mio_enabled_show(struct device *dev, { struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); - return sprintf(buf, zpci_use_mio(zdev) ? "1\n" : "0\n"); + return sysfs_emit(buf, zpci_use_mio(zdev) ? "1\n" : "0\n"); } static DEVICE_ATTR_RO(mio_enabled);