[PATCH v1 12/18] perf trace-event: Constify variables storing the result of strchr() on const tables
From: Shreenidhi Shedi
Date: Sat May 09 2026 - 14:06:37 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
commit 97b81df7225830c4db3c17ed1235d2f3eb613d3d uptream
As newer glibcs will propagate the const attribute of the searched table
to its return.
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Signed-off-by: Shreenidhi Shedi <yesshedi@xxxxxxxxx>
---
tools/perf/util/trace-event-info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 892c323b4ac9..5a6dec2dc0d8 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -477,7 +477,7 @@ static struct tracepoint_path *tracepoint_id_to_path(u64 config)
static struct tracepoint_path *tracepoint_name_to_path(const char *name)
{
struct tracepoint_path *path = zalloc(sizeof(*path));
- char *str = strchr(name, ':');
+ const char *str = strchr(name, ':');
if (path == NULL || str == NULL) {
free(path);
--
2.54.0