* linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?
@ 2016-02-16 8:15 David Binderman
2016-02-16 22:39 ` Daniel Axtens
0 siblings, 1 reply; 3+ messages in thread
From: David Binderman @ 2016-02-16 8:15 UTC (permalink / raw)
To: benh, paulus, mpe, linuxppc-dev
hello there=2C=0A=
=0A=
[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.=0A=
=0A=
Source code is=0A=
=0A=
=A0=A0=A0 emac =3D finddevice("/plb/opb/ethernet")=3B=0A=
=A0=A0=A0 if (emac> 0) {=0A=
=0A=
but=0A=
=0A=
=A0=A0=A0 void *emac=3B=0A=
=0A=
Suggest new code=0A=
=0A=
=A0=A0=A0 emac =3D finddevice("/plb/opb/ethernet")=3B=0A=
=A0=A0=A0 if (emac !=3D 0) {=0A=
=0A=
=0A=
Regards=0A=
=0A=
David Binderman=0A=
=
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?
2016-02-16 8:15 linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ? David Binderman
@ 2016-02-16 22:39 ` Daniel Axtens
2016-02-17 7:34 ` David Binderman
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Axtens @ 2016-02-16 22:39 UTC (permalink / raw)
To: David Binderman, benh, paulus, mpe, linuxppc-dev
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ?
2016-02-16 22:39 ` Daniel Axtens
@ 2016-02-17 7:34 ` David Binderman
0 siblings, 0 replies; 3+ messages in thread
From: David Binderman @ 2016-02-17 7:34 UTC (permalink / raw)
To: Daniel Axtens, benh, paulus, mpe, linuxppc-dev
Hello there Daniel=2C=0A=
=0A=
----------------------------------------=0A=
> That looks like a good suggestion: maybe make the test 'if (!emac)'=0A=
> rather than explicitly comparing with zero.=0A=
=0A=
Righto.=0A=
=0A=
> Are you comfortable sending a patch to that effect?=0A=
=0A=
Sorry=2C no. =0A=
=0A=
My email provider can't implement the somewhat strict whitespace=0A=
rules of kernel patches.=0A=
=0A=
Nothing stopping any keen person implementing that patch=2C however =3B->=
=0A=
=0A=
I checked the rest of the treeboot-akebono.c source code file with=0A=
the static analyser and found nothing wrong. No warnings from=0A=
gcc -Wextra=2C either=2C so after the patch=2C it looks ok to me.=0A=
=0A=
=0A=
Regards=0A=
=0A=
David Binderman=0A=
=0A=
=
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-17 7:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 8:15 linux-4.5-rc4/arch/powerpc/boot/treeboot-akebono.c:90: possible bad test ? David Binderman
2016-02-16 22:39 ` Daniel Axtens
2016-02-17 7:34 ` David Binderman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.