[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220422023734.129114-1-wanjiabing@vivo.com>
Date: Fri, 22 Apr 2022 10:37:34 +0800
From: Wan Jiabing <wanjiabing@...o.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: kael_w@...h.net, Wan Jiabing <wanjiabing@...o.com>
Subject: [PATCH] perf/x86/amd: Replace snprintf() with sysfs_emit()
Fix the following coccicheck warning:
arch/x86/events/amd/core.c:1127:8-16: WARNING: use scnprintf or sprintf.
Use sysfs_emit() instead of snprintf().
Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
---
arch/x86/events/amd/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index 8e1e818f8195..c1ced265c824 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -1124,7 +1124,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);
--
2.35.1
Powered by blists - more mailing lists