linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599: pointless test ?

Michael Ellerman mpe at ellerman.id.au
Mon Oct 9 16:01:48 AEDT 2017


David Binderman <dcb314 at hotmail.com> writes:
> Hello there,
>
> linux-4.14-rc3/arch/powerpc/perf/imc-pmu.c:599]: (style) Unsigned variable 'ncpu' can't be negative so it is unnecessary to test it.
>
> Source code is
>
>     if (ncpu >= 0 && ncpu < nr_cpu_ids) {
>
> but
>
>     unsigned int ncpu, core_id;
>
> Suggest remove test.

Thanks.

Notifying the author would be more helpful:

$ git blame -L 599,599 arch/powerpc/perf/imc-pmu.c
39a846db1d574 (Anju T Sudhakar 2017-07-19 03:06:35 +0530 599)   if (ncpu >= 0 && ncpu < nr_cpu_ids) {
$ git log -1 --format=%ae 39a846db1d574
anju at linux.vnet.ibm.com

cheers


More information about the Linuxppc-dev mailing list