[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fV+hfVLcmfPR-CKo7_ZB+AT7JpwV8rVVUAb7rmJNL705g@mail.gmail.com>
Date: Tue, 30 Sep 2025 06:34:28 -0700
From: Ian Rogers <irogers@...gle.com>
To: David Binderman <dcb314@...mail.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>, Kan Liang <kan.liang@...ux.intel.com>,
"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: inux-6.17/tools/perf/util/lzma.c:123: Strange return value ?
On Tue, Sep 30, 2025 at 3:19 AM David Binderman <dcb314@...mail.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
>
>
Powered by blists - more mailing lists