]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf time-utils: Constify variables storing the result of strchr() on const tables
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jan 2026 04:15:47 +0000 (01:15 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jan 2026 05:31:29 +0000 (02:31 -0300)
As newer glibcs will propagate the const attribute of the searched table
to its return.

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

index 1b91ccd4d52348550e8faa4b62f4c6a839030c91..d43c4577d7ebc93a0d35fc55dcf4f573664ba785 100644 (file)
@@ -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: