From: "Mi, Dapeng" <dapeng1.mi@linux.intel.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Miaoqian Lin <linmq006@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] perf tools: Fix bool return value in gzip_is_compressed()
Date: Mon, 13 Oct 2025 18:27:58 +0800 [thread overview]
Message-ID: <c8c40795-a459-4218-ba78-24f057c53a51@linux.intel.com> (raw)
In-Reply-To: <aOzDh4yhR5F0nMTG@google.com>
On 10/13/2025 5:16 PM, Namhyung Kim wrote:
> Hello,
>
> On Sat, Oct 11, 2025 at 11:48:56AM +0800, Mi, Dapeng wrote:
>> On 8/28/2025 6:46 PM, Miaoqian Lin wrote:
>>> gzip_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: 88c74dc76a30 ("perf tools: Add gzip_is_compressed function")
>>> Cc: <stable@vger.kernel.org>
>>> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
>>> ---
>>> tools/perf/util/zlib.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c
>>> index 78d2297c1b67..1f7c06523059 100644
>>> --- a/tools/perf/util/zlib.c
>>> +++ b/tools/perf/util/zlib.c
>>> @@ -88,7 +88,7 @@ bool gzip_is_compressed(const char *input)
>>> ssize_t rc;
>>>
>>> if (fd < 0)
>>> - return -1;
>>> + return false;
>>>
>>> rc = read(fd, buf, sizeof(buf));
>>> close(fd);
>> Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
> We have 43fa1141e2c1af79 ("perf util: Fix compression checks returning -1
> as bool").
Good to know this has been fixed. Thanks. :)
>
> Thanks,
> Namhyung
>
next prev parent reply other threads:[~2025-10-13 10:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 10:46 [PATCH] perf tools: Fix bool return value in gzip_is_compressed() Miaoqian Lin
2025-10-11 3:48 ` Mi, Dapeng
2025-10-13 9:16 ` Namhyung Kim
2025-10-13 10:27 ` Mi, Dapeng [this message]
2025-10-14 18:25 ` Arnaldo Carvalho de Melo
2025-10-14 18:34 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8c40795-a459-4218-ba78-24f057c53a51@linux.intel.com \
--to=dapeng1.mi@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox