[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250828105048.55247-1-linmq006@gmail.com>
Date: Thu, 28 Aug 2025 18:50:47 +0800
From: Miaoqian Lin <linmq006@...il.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
Stephen Brennan <stephen.s.brennan@...cle.com>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: linmq006@...il.com,
stable@...r.kernel.org
Subject: [PATCH] perf lzma: Fix return value in lzma_is_compressed()
lzma_is_compressed() returns -1 on error but is declared as bool.
And -1 gets converted to true, which could be misleading.
Return false instead to match the declared type.
Fixes: 4b57fd44b61b ("perf tools: Add lzma_is_compressed function")
Cc: <stable@...r.kernel.org>
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
tools/perf/util/lzma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c
index bbcd2ffcf4bd..c355757ed391 100644
--- a/tools/perf/util/lzma.c
+++ b/tools/perf/util/lzma.c
@@ -120,7 +120,7 @@ bool lzma_is_compressed(const char *input)
ssize_t rc;
if (fd < 0)
- return -1;
+ return false;
rc = read(fd, buf, sizeof(buf));
close(fd);
--
2.39.5 (Apple Git-154)
Powered by blists - more mailing lists