linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?

Daniel Axtens dja at axtens.net
Wed Feb 17 09:39:56 AEDT 2016


Hi David,

>
> [linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90]: (style) A pointer can not be negative so it is either pointless or an error to check if it is not.
>
> Source code is
>
>     emac = finddevice("/plb/opb/ethernet");
>     if (emac> 0) {
>
> but
>
>     void *emac;
>
> Suggest new code
>
>     emac = finddevice("/plb/opb/ethernet");
>     if (emac != 0) {
>
>

That looks like a good suggestion: maybe make the test 'if (!emac)'
rather than explicitly comparing with zero.

Are you comfortable sending a patch to that effect? A patch generated by
git format-patch and sent with git send-email are usually the easiest.

If you have any difficulties, feel free to ping me off-list and I can
walk you through the process.

Regards,
Daniel


More information about the Linuxppc-dev mailing list