From: Mete Durlu Date: Wed, 23 Oct 2024 12:10:56 +0000 (+0200) Subject: s390/smp: Switch over to sysfs_emit() X-Git-Tag: v6.13-rc1~206^2~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b2a85a24b9914248f9648abc115672fa1e5b11c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Gerd Bayer Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 7cf295708384b..822d8e6f87171 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -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);