[PATCH v1 15/18] perf time-utils: Constify variables storing the result of strchr() on const tables

From: Shreenidhi Shedi

Date: Sat May 09 2026 - 14:08:10 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

commit 21c0bc9144834e39762dd6fddbb255ebb80cf079 upstream

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/time-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 1b91ccd4d523..d43c4577d7eb 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -325,7 +325,7 @@ static int percent_comma_split(struct perf_time_interval *ptime_buf, int num,
}

static int one_percent_convert(struct perf_time_interval *ptime_buf,
- const char *ostr, u64 start, u64 end, char *c)
+ const char *ostr, u64 start, u64 end, const char *c)
{
char *str;
int len = strlen(ostr), ret;
@@ -358,7 +358,7 @@ static int one_percent_convert(struct perf_time_interval *ptime_buf,
int perf_time__percent_parse_str(struct perf_time_interval *ptime_buf, int num,
const char *ostr, u64 start, u64 end)
{
- char *c;
+ const char *c;

/*
* ostr example:
--
2.54.0