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

platform/x86: intel-uncore-freq: Use sysfs_emit() to instead of scnprintf()

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220923063314.239146-1-ye.xingchen@zte.com.cn
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

ye xingchen and committed by
Hans de Goede
76a13da7 bbfa903b

+1 -1
+1 -1
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
··· 113 113 struct uncore_data *data = container_of(attr, struct uncore_data,\ 114 114 member_name##_dev_attr);\ 115 115 \ 116 - return scnprintf(buf, PAGE_SIZE, "%u\n", \ 116 + return sysfs_emit(buf, "%u\n", \ 117 117 data->member_name); \ 118 118 } \ 119 119