]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf trace: Deal with compiler const checks
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jan 2026 20:57:43 +0000 (17:57 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jan 2026 23:49:59 +0000 (20:49 -0300)
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@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c

index 58a32adafddff7f5eda6ee1726eae07806ab4cc2..8df5ca44e4f9152957a3254c7d7f659287147fdd 100644 (file)
@@ -5190,7 +5190,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;