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

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Thu May 8 23:11:51 CEST 2014


On Thu, 08 May 2014 22:51:43 +0200
Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:

> Am 08.05.2014 18:56 schrieb Stefan Tauner:
> > 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.
> 
> NACK. flashchips.c should only have data, not code.

Says who, and more importantly why? :)

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list