From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Yunseong Kim <ysk@kzalloc.com>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
Stephen Brennan <stephen.s.brennan@oracle.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf util: Fix compression checks returning -1 as bool
Date: Fri, 12 Sep 2025 15:42:59 -0300 [thread overview]
Message-ID: <aMRps1jV6VHPOnT-@x1> (raw)
In-Reply-To: <CAP-5=fUcsd--WrwEnRja2pX+-5Z6d4Qyf7t4Fybhixw+WYY-5Q@mail.gmail.com>
On Fri, Aug 22, 2025 at 09:34:07AM -0700, Ian Rogers wrote:
> On Fri, Aug 22, 2025 at 9:28 AM Yunseong Kim <ysk@kzalloc.com> wrote:
> >
> > The lzma_is_compressed and gzip_is_compressed functions are declared
> > to return a "bool" type, but in case of an error (e.g., file open
> > failure), they incorrectly returned -1.
> >
> > A bool type is a boolean value that is either true or false.
> > Returning -1 for a bool return type can lead to unexpected behavior
> > and may violate strict type-checking in some compilers.
> >
> > Fix the return value to be false in error cases, ensuring the function
> > adheres to its declared return type improves for preventing potential
> > bugs related to type mismatch.
> >
> > Fixes: 4b57fd44b61b ("perf tools: Add lzma_is_compressed function")
> > Fixes: 88c74dc76a30 ("perf tools: Add gzip_is_compressed function")
> > Signed-off-by: Yunseong Kim <ysk@kzalloc.com>
>
> Reviewed-by: Ian Rogers <irogers@google.com>
Thanks, applied to perf-tools-next,
- Arnaldo
prev parent reply other threads:[~2025-09-12 18:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 16:25 [PATCH] perf util: Fix compression checks returning -1 as bool Yunseong Kim
2025-08-22 16:34 ` Ian Rogers
2025-09-12 18:42 ` Arnaldo Carvalho de Melo [this message]
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=aMRps1jV6VHPOnT-@x1 \
--to=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=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=stephen.s.brennan@oracle.com \
--cc=ysk@kzalloc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.