
12 May
2008
12 May
'08
12:44 a.m.
In message 1210453324547-git-send-email-nick.spence@freescale.com you wrote:
Calculation of tail was incorrect when size % 4 == 0.
New code removes the conditional and does the same thing but with arithmetic
Signed-off-by: Nick Spence nick.spence@freescale.com
The minimum change is to re-insert the original check:
if ((uimage_to_cpu (size[i]) % 4) != 0) tail += (4 - uimage_to_cpu (size[i]) % 4);
or a variation on this.
The proposed patch cleans up the code a little further by removing the condition entirely and achieving the same rounding-up effect a little more cleanly and clearly.
common/image.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-)
Applied, thanks.
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
Schshschshchsch.
-- The Gorn, "Arena", stardate 3046.2