lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240126061319.245901-3-lizhijian@fujitsu.com>
Date: Fri, 26 Jan 2024 14:13:18 +0800
From: Li Zhijian <lizhijian@...itsu.com>
To: linux-kernel@...r.kernel.org
Cc: Li Zhijian <lizhijian@...itsu.com>,
	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>,
	Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	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
Subject: [PATCH v2 3/4] arch/x86/events/core: use scnprintf to print sub-string

sysfs_emit is not suitable to to print a substring, convert it to scnprintf
to make coccicheck happy.

CC: Peter Zijlstra <peterz@...radead.org>
CC: Ingo Molnar <mingo@...hat.com>
CC: Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Mark Rutland <mark.rutland@....com>
CC: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
CC: Jiri Olsa <jolsa@...nel.org>
CC: Namhyung Kim <namhyung@...nel.org>
CC: Ian Rogers <irogers@...gle.com>
CC: Adrian Hunter <adrian.hunter@...el.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Borislav Petkov <bp@...en8.de>
CC: Dave Hansen <dave.hansen@...ux.intel.com>
CC: x86@...nel.org
CC: "H. Peter Anvin" <hpa@...or.com>
CC: linux-perf-users@...r.kernel.org
Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
---
V2: new patch address coccinelle warning
---
 arch/x86/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 20d963196e4c..5ed2ba16c6c0 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -1892,7 +1892,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev,
 		if (x86_pmu.hybrid_pmu[i].pmu_type & pmu->pmu_type) {
 			next_str = strchr(str, ';');
 			if (next_str)
-				return snprintf(page, next_str - str + 1, "%s", str);
+				return scnprintf(page, next_str - str + 1, "%s", str);
 			else
 				return sysfs_emit(page, "%s", str);
 		}
-- 
2.29.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ