[flashrom] Minor Code cleanup resulting in a smaller binary

Mathias Krause mathias.krause at secunet.com
Mon Jan 10 10:21:41 CET 2011

On 07.01.2011 20:12, Diego Elio Pettenò wrote:
> Il giorno mer, 05/01/2011 alle 13.03 +0100, Mathias Krause ha scritto:
>> +       static const char *speed_names[4] = {
> I'd suggest using "static const char *const" at least (for PIE builds),
> or convert some of those to complete arrays.

I don't know how PIE may interference with this - it shouldn't matter if
the array is writable or not - but you're right, the array should be
marked const, too. Even though the compiler seems to be clever enough to
notice no writes to the array are made and puts it into the .rodata
section, too. Nevertheless, to be correct also on the source level,
attached is a new version of the patch.

Thanks, for the review!

Kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: static_const.diff
Type: text/x-patch
Size: 8257 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110110/ff8a9080/attachment.diff>

More information about the flashrom mailing list