[PATCH v1 05/18] perf trace: Deal with compiler const checks
From: Shreenidhi Shedi
Date: Sat May 09 2026 - 14:02:18 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
commit 2c850606a46b319d5128bda59f67b1fc642d94ef upstream
The strchr() function these days return const/non-const based on the arg
it receives, and sometimes we need to use casts when we're dealing with
variables that are used in code that needs to safely change the returned
value and sometimes not (as it points to really const areas).
Tweak one such case.
Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Signed-off-by: Shreenidhi Shedi <yesshedi@xxxxxxxxx>
---
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 441655e659c2..313eb0929324 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -4622,7 +4622,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
}
while (1) {
- if ((sep = strchr(s, ',')) != NULL)
+ if ((sep = strchr((char *)s, ',')) != NULL)
*sep = '\0';
list = 0;
--
2.54.0