Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <schnelle@linux.ibm.com>
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Gerd Bayer and committed by
Heiko Carstens
bc7f911b 31d1d8a3

+2 -2
+2 -2
arch/s390/pci/pci_sysfs.c
··· 23 23 { \ 24 24 struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); \ 25 25 \ 26 - return sprintf(buf, fmt, zdev->member); \ 26 + return sysfs_emit(buf, fmt, zdev->member); \ 27 27 } \ 28 28 static DEVICE_ATTR_RO(name) 29 29 ··· 45 45 { 46 46 struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); 47 47 48 - return sprintf(buf, zpci_use_mio(zdev) ? "1\n" : "0\n"); 48 + return sysfs_emit(buf, zpci_use_mio(zdev) ? "1\n" : "0\n"); 49 49 } 50 50 static DEVICE_ATTR_RO(mio_enabled); 51 51