perf/x86/amd/lbr:convert sysfs snprintf to sysfs_emit
Commit Message
Fix the following coccicheck warning:
arch/x86/events/amd/core.c:1276:8-16: WARNING: use scnprintf or sprintf
Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
arch/x86/events/amd/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1272,7 +1272,7 @@ static ssize_t branches_show(struct device *cdev,
struct device_attribute *attr,
char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu.lbr_nr);
+ return sysfs_emit(buf, "%d\n", x86_pmu.lbr_nr);
}
static DEVICE_ATTR_RO(branches);