]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf units: 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:28:33 +0000 (02:28 -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/units.c

index 4c6a86e1cb54b222c75d9b02dbf70319b1711a4f..0bbacf5a29aaf5ae0730bab0570f0a996d525d86 100644 (file)
@@ -12,7 +12,7 @@ unsigned long parse_tag_value(const char *str, struct parse_tag *tags)
        struct parse_tag *i = tags;
 
        while (i->tag) {
-               char *s = strchr(str, i->tag);
+               const char *s = strchr(str, i->tag);
 
                if (s) {
                        unsigned long int value;