linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-6.16/tools/perf/util/tool_pmu.c:242: Pointless test ?
@ 2025-08-06  6:09 David Binderman
  2025-08-06 23:12 ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: David Binderman @ 2025-08-06  6:09 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, acme@kernel.org, namhyung@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
	Linux Kernel Mailing List

Hello there,

Static analyser cppcheck says:

linux-6.16/tools/perf/util/tool_pmu.c:242:15: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]

Source code is

        for (thread = 0; thread < nthreads; thread++) {
            if (thread >= nthreads)
                break;

Suggest remove if test.

Regards

David Binderman

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-6.16/tools/perf/util/tool_pmu.c:242: Pointless test ?
  2025-08-06  6:09 linux-6.16/tools/perf/util/tool_pmu.c:242: Pointless test ? David Binderman
@ 2025-08-06 23:12 ` Namhyung Kim
  2025-08-07  5:24   ` David Binderman
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2025-08-06 23:12 UTC (permalink / raw)
  To: David Binderman
  Cc: Peter Zijlstra, Ingo Molnar, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
	Linux Kernel Mailing List

Hello,

On Wed, Aug 06, 2025 at 06:09:40AM +0000, David Binderman wrote:
> Hello there,
> 
> Static analyser cppcheck says:
> 
> linux-6.16/tools/perf/util/tool_pmu.c:242:15: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
> 
> Source code is
> 
>         for (thread = 0; thread < nthreads; thread++) {
>             if (thread >= nthreads)
>                 break;
> 
> Suggest remove if test.

Thanks for the report.  Do you want us to remove or will you send a
patch?  It'd be great if you can send one.

Thanks,
Namhyung


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-6.16/tools/perf/util/tool_pmu.c:242: Pointless test ?
  2025-08-06 23:12 ` Namhyung Kim
@ 2025-08-07  5:24   ` David Binderman
  0 siblings, 0 replies; 3+ messages in thread
From: David Binderman @ 2025-08-07  5:24 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Ingo Molnar, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
	Linux Kernel Mailing List

Hello there,

>Thanks for the report.  

You are welcome.

>Do you want us to remove or will you send a patch? 

All my patches fail, so option 1, please.

Regards

David Binderman

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-07  5:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06  6:09 linux-6.16/tools/perf/util/tool_pmu.c:242: Pointless test ? David Binderman
2025-08-06 23:12 ` Namhyung Kim
2025-08-07  5:24   ` David Binderman

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).