[U-Boot-Users] [PATCH] Fix offset calculation for multi-type legacy images.

Wolfgang Denk wd at denx.de
Mon May 12 00:44:38 CEST 2008


In message <1210453324547-git-send-email-nick.spence at 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 at 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 at denx.de
Schshschshchsch.
	-- The Gorn, "Arena", stardate 3046.2




More information about the U-Boot mailing list