From: Wolfgang Denk Date: Wed, 21 May 2008 22:17:23 +0200 Subject: [U-Boot-Users] [PATCH v2] PPC4xx: Simplified post_word_{load, store} In-Reply-To: Your message of "Wed, 21 May 2008 12:43:18 PDT." <1211398998-30954-1-git-send-email-gerickson@nuovations.com> Message-ID: <20080521201723.1C8D2247F5@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1211398998-30954-1-git-send-email-gerickson@nuovations.com> 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. 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 at denx.de I express preference for a chronological sequence of events which precludes a violence. - Terry Pratchett, _The Dark Side of the Sun_