* [PATCH] util: constant -1 with expression of type char
@ 2024-06-19 20:34 yskelg
2024-06-26 4:00 ` Namhyung Kim
0 siblings, 1 reply; 2+ messages in thread
From: yskelg @ 2024-06-19 20:34 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter
Cc: kan.liang, Yang Jihong, Ze Gao, Leo Yan, Ravi Bangoria,
Austin Kim, shjy180909, linux-perf-users, linux-kernel,
Yunseong Kim
From: Yunseong Kim <yskelg@gmail.com>
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>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 25857894c047..bc603193c477 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -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);
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] util: constant -1 with expression of type char
2024-06-19 20:34 [PATCH] util: constant -1 with expression of type char yskelg
@ 2024-06-26 4:00 ` Namhyung Kim
0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2024-06-26 4:00 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
Jiri Olsa, Ian Rogers, Adrian Hunter, yskelg
Cc: kan.liang, Yang Jihong, Ze Gao, Leo Yan, Ravi Bangoria,
Austin Kim, shjy180909, linux-perf-users, linux-kernel
On Thu, 20 Jun 2024 05:34:29 +0900, yskelg@gmail.com wrote:
> 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)
> | ~ ^ ~~
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-26 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 20:34 [PATCH] util: constant -1 with expression of type char yskelg
2024-06-26 4:00 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).