[U-Boot] [PATCH 13/17] post/i2c: Add ability to ignore I2C devices
Peter Tyser
ptyser at xes-inc.com
Thu Sep 30 17:42:37 CEST 2010
Hi Sergei,
> Peter Tyser wrote:
>
> >>>> +#ifdef I2C_ADDR_IGNORE_LIST
> >>>> + unsigned char i2c_ignore_list[] = I2C_ADDR_IGNORE_LIST;
>
> >>> This array is aking to be *static*...
>
> >> ... and *const* as well ?
>
> > I'll add 'const' in the next version, but I'm not sure if the 'static'
> > adds any benefit since its a local variable.
>
> Have you considered the amount of code needed for non-static array
> initialization?
I think I did:) I'd think a const array would generate nearly identical
code with or without the static qualifier. In either case the function
will load a pointer to the array and loop through it. The array should
be stored in the data section of the U-Boot binary so I'm not sure how
the array initialization differs. I did a quick comparison for this
specific case and the resulting sizes came out the same:
ptyser at petert u-boot $ size ./i2c-static.o
text data bss dec hex filename
347 12 0 359 167 ./i2c-static.o
ptyser at petert u-boot $ size ./i2c-nonstatic.o
text data bss dec hex filename
347 12 0 359 167 ./i2c-nonstatic.o
Is there something I'm overlooking?
Regards,
Peter
More information about the U-Boot
mailing list