linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: David Binderman <dcb314@hotmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	 "mark.rutland@arm.com" <mark.rutland@arm.com>,
	 "alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	 "linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: inux-6.17/tools/perf/util/lzma.c:123: Strange return value ?
Date: Tue, 30 Sep 2025 06:34:28 -0700	[thread overview]
Message-ID: <CAP-5=fV+hfVLcmfPR-CKo7_ZB+AT7JpwV8rVVUAb7rmJNL705g@mail.gmail.com> (raw)
In-Reply-To: <VI1PR02MB39525F61113D96E3671BFA1F9C1AA@VI1PR02MB3952.eurprd02.prod.outlook.com>

On Tue, Sep 30, 2025 at 3:19 AM David Binderman <dcb314@hotmail.com> wrote:
>
> Hello there,
>
> Static analyser cppcheck says:
>
> linux-6.17/tools/perf/util/lzma.c:123:3: style: Non-boolean value returned from function returning bool [returnNonBoolInBooleanFunction]
>
> Source code is
>
> bool lzma_is_compressed(const char *input)
> {
>     int fd = open(input, O_RDONLY);
>     const uint8_t magic[6] = { 0xFD, '7', 'z', 'X', 'Z', 0x00 };
>     char buf[6] = { 0 };
>     ssize_t rc;
>
>     if (fd < 0)
>         return -1;
>
> Suggest return either true or false.
>
> Also, there is a duplicate of this problem at file linux-6.17/tools/perf/util/zlib.c
> line 91.

Thanks, a fix was already committed to the next branch:
https://lore.kernel.org/lkml/20250822162506.316844-3-ysk@kzalloc.com/
and the fixes tags should mean it isn't long before it is backported
to the stable branches.

Ian

> Regards
>
> David Binderman
>
>

      reply	other threads:[~2025-09-30 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30 10:19 inux-6.17/tools/perf/util/lzma.c:123: Strange return value ? David Binderman
2025-09-30 13:34 ` Ian Rogers [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='CAP-5=fV+hfVLcmfPR-CKo7_ZB+AT7JpwV8rVVUAb7rmJNL705g@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dcb314@hotmail.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=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).