On 15.12.2008 02:50, Carl-Daniel Hailfinger wrote:
> On 14.12.2008 19:26, Stephan GUILLOUX wrote:
>   
>> Corey Osgood a écrit :
>>     
>>> On Sun, Dec 14, 2008 at 12:53 PM, Stephan GUILLOUX 
>>> <[email protected]>
>>> wrote:
>>>       Hello all,
>>>
>>>     Using flashrom for some times, I find that flashchips array becomes
>>>     difficult to read.
>>>     To be able to read a single entry, in this array, you need to expand 
>>> your
>>>     editor window
>>>     to its maximum size and reduce the font size. Any new field in this 
>>> array
>>>     will result
>>>     in a nightmare to read and for support.
>>>
>>>     My suggestion for this, is to detail each line with field names, like 
>>> with
>>>     the extract
>>>     below :
>>>     [...]
>>>       {
>>>           .vendor         = "AMD",
>>>           .name           = "Am29F016D",
>>>           .manufacture_id = AMD_ID,
>>>           .model_id       = AM_29F016D,
>>>           .total_size     = 2048,
>>>           .page_size      = 64 * 1024,
>>>           .tested         = TEST_UNTESTED,
>>>           .probe          = probe_29f040b,
>>>           .erase          = erase_29f040b,
>>>           .write          = write_29f040b,
>>>       },
>>>     [...]
>>>
>>>
>>> Good idea, but someone already had it ;) Take a look at a fresh checkout of 
>>> flashrom, not quite the same but very similar.
>>>       
>> I know. This patch is based on this work too.
>> But still difficult to parse to add/remove any field.
>>   
>>     
>
> Agreed.
>
>
>   
>>> -Corey
>>>
>>>
>>>     This kind of syntax makes flashchips.c rather longer in term of lines, 
>>> but
>>>     keeps it
>>>     readable, and easily parsable with an external shell/tool...
>>>
>>>     Any comment ?
>>>
>>>     Also in attachement.
>>>
>>>       Stephan.
>>>
>>>     Signed-off-by: Stephan Guilloux <[email protected]>
>>>       
>>   
>>     
>
> Awesome!
> The patch improves machine parseability and human readability over
> what's currently in flashrom HEAD. And the explicit initialization makes
> sure any future struct flashchip reordering is not needed. (And I can
> throw away some of my pending patches because this solution is cleaner
> and fulfills all my requirements.)
>
> Acked-by: Carl-Daniel Hailfinger <[email protected]>
>   

Committed in r3851.

I assume you have a script or some other way to convert flashchips.c. I
have quite a few pending chip changes for that file and manually
updating all of them is going to be a nightmare. Can you dig up that
script and mail it to the list or may I send my flashchips.c variants to
you for conversion? Thanks!

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/


--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to