]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf tp_pmu: Address const-correctness errors in recent glibcs
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jan 2026 05:22:00 +0000 (02:22 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jan 2026 05:22:00 +0000 (02:22 -0300)
To avoid having more variables, just cast the const variable searched to
non-const since the result will not be modified, its only later that
that variable will be used to modify something, but then its non-const
memory being modified, so using a cast is the cheapest thing here.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/tp_pmu.c

index eddb9807131ab6981d614b917a6ca71ff70f5566..c2be8c9f9084da155c81031b6888eb87414095f8 100644 (file)
@@ -192,7 +192,7 @@ bool tp_pmu__have_event(struct perf_pmu *pmu __maybe_unused, const char *name)
        char *dup_name, *colon;
        int id;
 
-       colon = strchr(name, ':');
+       colon = strchr((char *)name, ':');
        if (colon == NULL)
                return false;