]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/pci: Switch over to sysfs_emit
authorGerd Bayer <gbayer@linux.ibm.com>
Mon, 30 Sep 2024 11:41:43 +0000 (13:41 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 10 Oct 2024 13:32:43 +0000 (15:32 +0200)
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 <schnelle@linux.ibm.com>
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/pci/pci_sysfs.c

index 1f81f6ff7b954b3748e386a2482659cf96f90098..055a75b3f59d7e7abc3b3b24e19eb9afa32a22e9 100644 (file)
@@ -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);