
Dear Wolfgang Denk,
On Sun, Oct 16, 2011 at 1:04 PM, Wolfgang Denk wd@denx.de wrote:
Dear Vadim Bendebury,
In message CANy1buJCjdQnpQ6EHTjJ3jOvGe5fKqDoDpevofhu6_-2Y7L6gg@mail.gmail.com you wrote:
Also, what about situations when one reviewer requests a certain implementation and another one finds it inappropriate?
Here we had several people (Marek and me) asking the same thing. And actually my message was intended to tell you that I agree with Marek.
In case of doubt, someone has to make a final decision.
In this specific case I already decided (and told you) that I want to see a function instead of a macro.
yes, I saw it and have already changed the implementation.
Can you please also confirm that having a structure with a single element as an array is "weird" and must be changed to passing around a pointer to a single element without the size (or maybe the idea is that the pointer AND the size need to be passed around)?
Yes, I consider this weird, too. And you failed to provide a good explanation why you think this would be needed so far.
My explanation is that it is better readable when the entire information about a chip is contained in one type, as opposed to having the size separate and needed to be carried around (instead of using ARRAY_SIZE() when needed). When the pointer to the chip structure is passed around, the recipient does not have to be aware of a separate definition, all information about the chip is contained in a structure.
Sorry, I am restating the reasons here because I am not sure if you wrote your previous reply before seeing them.
Please let me know if you don't find this explanation convincing, I will change the code as you suggest.
Are macros acceptable to wrap input output with debug messages, as was suggested earlier on this list, or should I replace each macro with two inline functions?
Sorry, I don't remember which code you are referring to here.
I am referring to this message:
http://lists.denx.de/pipermail/u-boot/2011-October/104780.html
which is a part of this thread:
http://lists.denx.de/pipermail/u-boot/2011-October/104665.html
cheers, /vb
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "I'm growing older, but not up." - Jimmy Buffett