mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
s390/smp: Switch over to sysfs_emit()
Per Documentation/filesystems/sysfs.rst, sysfs_emit() is preferred over sprintf for presenting attributes to user space. Convert the left-over uses in the s390/smp code. Signed-off-by: Mete Durlu <meted@linux.ibm.com> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
b4b920cded
commit
5b2a85a24b
@ -1011,7 +1011,7 @@ static ssize_t cpu_configure_show(struct device *dev,
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&smp_cpu_state_mutex);
|
||||
count = sprintf(buf, "%d\n", per_cpu(pcpu_devices, dev->id).state);
|
||||
count = sysfs_emit(buf, "%d\n", per_cpu(pcpu_devices, dev->id).state);
|
||||
mutex_unlock(&smp_cpu_state_mutex);
|
||||
return count;
|
||||
}
|
||||
@ -1083,7 +1083,7 @@ static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
|
||||
static ssize_t show_cpu_address(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", per_cpu(pcpu_devices, dev->id).address);
|
||||
return sysfs_emit(buf, "%d\n", per_cpu(pcpu_devices, dev->id).address);
|
||||
}
|
||||
static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user