Thread (3 messages) flat view 3 messages, 2 authors, 2016-02-17

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

From: Daniel Axtens <hidden>
Date: 2016-02-16 22:40:03

Hi David,
[linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90]: (style) A pointe=
r can not be negative so it is either pointless or an error to check if it =
is not.
Source code is

=C2=A0=C2=A0=C2=A0 emac =3D finddevice("/plb/opb/ethernet");
=C2=A0=C2=A0=C2=A0 if (emac> 0) {

but

=C2=A0=C2=A0=C2=A0 void *emac;

Suggest new code

=C2=A0=C2=A0=C2=A0 emac =3D finddevice("/plb/opb/ethernet");
=C2=A0=C2=A0=C2=A0 if (emac !=3D 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help