This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
Re: NAND technical review
Jonathan Larmour wrote:
Rutger Hofman wrote:
Jonathan Larmour wrote:
On a separate point, while I'm here, I think the use of printf via
cyg_nand_global.pf would want tidied up a lot. Some of them seem to be
there to mention errors to the user, but without any programmatic
treatment of the errors, primarily reporting them to higher layers.
It should also be possible to eliminate the overheads of the printf.
Right now there's quite a lot of them, involving function calls,
allocation of const string data, and occasionally calculation of
arguments, even if the pf function pointer is pointing to an empty null
printf function. It should be possible to turn them off entirely, and
not be any worse off for it (including error reporting back up to higher
layers). It might not be so bad if the strings were a lot shorter, or
the printf functions less frequently used, but being able to turn them
off entirely would seem better.
I agree. Many of the printfs are leftovers from debugging stages. They
should go (and will go anyway at a next code cleanup), and an error
should be reported upwards where that isn't done yet; or possibly
asserts when they flag a programming error in this layer -- preferences?
I will do this somewhere in the coming weeks.
When the dependency on a memory allocator is also gone (see other
response), there is no practical obstacle left to switch from explicit
initialisation to init-time constructor.
If this makes a difference in acceptance, I will convert from malloc and
explicit initialisation somewhere within one month.
Rutger