]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
util: constant -1 with expression of type char
authorYunseong Kim <yskelg@gmail.com>
Wed, 19 Jun 2024 20:34:29 +0000 (05:34 +0900)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 25 Jun 2024 18:06:20 +0000 (11:06 -0700)
This patch resolve following warning.

  tools/perf/util/evsel.c:1620:9: error: result of comparison of constant
   -1 with expression of type 'char' is always false
   -Werror,-Wtautological-constant-out-of-range-compare
   1620 |                 if (c == -1)
        |                     ~ ^  ~~

Signed-off-by: Yunseong Kim <yskelg@gmail.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Austin Kim <austindh.kim@gmail.com>
Cc: shjy180909@gmail.com
Cc: Ze Gao <zegao2021@gmail.com>
Cc: Leo Yan <leo.yan@linux.dev>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240619203428.6330-2-yskelg@gmail.com
tools/perf/util/evsel.c

index 25857894c0479cb87eee3d40ce055d8d0d0054ff..bc603193c477730ee409bc453a99491189d707cc 100644 (file)
@@ -1620,7 +1620,7 @@ static int evsel__read_group(struct evsel *leader, int cpu_map_idx, int thread)
 
 static bool read_until_char(struct io *io, char e)
 {
-       char c;
+       int c;
 
        do {
                c = io__get_char(io);