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:
pty...@petert u-boot $ size ./i2c-static.o
text data bss dec hex filename
347 12 0 359 167 ./i2c-static.o
pty...@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
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot