On 5/21/08 1:17 PM, Wolfgang Denk wrote:

> In message <[EMAIL PROTECTED]> you
> wrote:
>> This patch simplifies post_word_{load,store} by using the preprocessor
>> to eliminate redundant, copy-and-pasted code.
> ...
> 
>> +#if defined(CFG_POST_WORD_ADDR)
>> +# define _POST_ADDR (CFG_OCM_DATA_ADDR + CFG_POST_WORD_ADDR)
> 
> Please make this
> 
> # define _POST_ADDR ((CFG_OCM_DATA_ADDR) + (CFG_POST_WORD_ADDR))
> 
> This *is* important. Assume
> 
> #define CFG_OCM_DATA_ADDR 8 | 1
> #define CFG_POST_WORD_ADDR 16 | 3
> 
> Then ((CFG_OCM_DATA_ADDR) + (CFG_POST_WORD_ADDR)) gives 28 as
> intended, but (CFG_OCM_DATA_ADDR + CFG_POST_WORD_ADDR) gives 27.

Agreed and I will make the change; however, were that the case, I would tend
to favor the approach that the responsibility is on the definer of '8 | 1'
and '16 | 3' to wrap those in parens. Thankfully, parens are a free
resource.

Regards,

Grant



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to