[coreboot] [PATCH] flashrom patch easier board_pciid_enables parsing

Luc Verhaegen libv at skynet.be
Wed Jan 14 02:28:39 CET 2009


On Tue, Jan 13, 2009 at 03:23:26PM -0800, ron minnich wrote:
> On Tue, Jan 13, 2009 at 3:34 PM, Luc Verhaegen <libv at skynet.be> wrote:
> > On Tue, Jan 13, 2009 at 10:02:15PM +0100, Stephan GUILLOUX wrote:
> >>
> >>    Hello,
> >>
> >> Similarly to flashchips array, this patch intends to make the table
> >> board_pciid_enables more readable.
> >>
> >> Also in attachment.
> >
> > For certain versions of readable. What real problem does this solve?
> >
> 
> 1. Next time someone adds a new struct member, we avoid mistakes of
> ordering of initializers
> 2. we avoid mistakes in the first place.
> 
> The .x = y stuff was added for a (good) reason, I think this is an improvement.
> 
> Acked-by: Ronald G. Minnich <rminnich at gmail.com>

I personally prefer (very long) single lines for a table like this. 

Single long lines make it easy to visually parse, provided the editor is
set wide enough to show the whole table. Long lines only stop people 
from easily parsing this code in a 80char terminal, but the 80char 
boundary is being significantly broken in ther files of flashrom. And it 
really is the least of the two possible pains, would you rather break 
readability for all or just for those who know that this table should 
not be edited when blindfold?

Strings should be padded to a common length, so that all but the last 
member is fully aligned. No errors can then occur when a new member is 
added, as the difference between entries become immediately clear. How 
often have new struct members been added since this table was created 
close to two years ago?

Luc Verhaegen.




More information about the coreboot mailing list