[U-Boot] [PATCH] minor improvements for env tools

Wolfgang Denk wd at denx.de
Mon Sep 5 23:02:31 CEST 2011


Dear Luka Perkov,

In message <20110905203848.GA12498 at w500.gigaset.lan> you wrote:
> Patch from openwrt commit r20062 regarding erase_len.
> 
> Correct types inside two fprintf functions.
> 
> Signed-off-by: Luka Perkov < lists ->-to->- lukaperkov.net >
> ---
> 
> diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
> index ed6b53f..4e4f6aa 100644
> --- a/tools/env/fw_env.c
> +++ b/tools/env/fw_env.c
> @@ -488,7 +488,7 @@ int fw_setenv(int argc, char *argv[])
>  			value = (char *)malloc(len - strlen(name));
>  			if (!value) {
>  				fprintf(stderr,
> -				"Cannot malloc %u bytes: %s\n",
> +				"Cannot malloc %zu bytes: %s\n",
>  				len - strlen(name), strerror(errno));
>  				return -1;
>  			}
> @@ -779,7 +779,10 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
>  	erase_offset = (offset / blocklen) * blocklen;
>  
>  	/* Maximum area we may use */
> -	erase_len = top_of_range - erase_offset;
> +	if (mtd_type == MTD_NANDFLASH)
> +		erase_len = top_of_range - erase_offset;
> +	else
> +		erase_len = blocklen;

This is obviously not a printf() type fix.  Please submit as separate
patch, with exact descrition what this is good for, i. e. which
problem it fixes.

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
"In matrimony, to hesitate is sometimes to be saved."        - Butler


More information about the U-Boot mailing list