[flashrom] [PATCH] CID1130005: Array compared against 0

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Thu May 8 18:56:58 CEST 2014


On Tue, 19 Nov 2013 20:35:57 +0100
Stefan Reinauer <stefan.reinauer at coreboot.org> wrote:

> CID1130005: Array compared against 0
> 
> The address of an array is never NULL, so the comparison will always evaluate
> the same way.
> In selfcheck: Array compared against NULL pointer
> 
> Since the array is defined unconditionally in C code the check does not really
> make sense. It might make more sense to check whether there are entries in the
> array, but that is not required on all platforms so far.

Thanks for reporting this. I have attached by approach to fix this.
IMHO it makes no sense to check the array outside its compilation unit.
That's just stupid. Instead I move the checks of the flashchips array
from flashrom.c to flashchips.c and remove all others that are futile
anyway.

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-selfcheck-of-array-flashchips-into-flashchips.c.patch
Type: text/x-patch
Size: 8374 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20140508/260ca43b/attachment.patch>


More information about the flashrom mailing list