[U-Boot] [U-Boot, 03/10] mtd: nand: s3c: Fix data type width in debug()

Scott Wood scottwood at freescale.com
Thu Nov 27 03:06:14 CET 2014


On Sat, Oct 11, 2014 at 06:42:51PM +0200, Marek Vasut wrote:
> Printing u32 with %02x is just a bad idea, fix it.
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Kyungmin Park <kyungmin.park at samsung.com>
> Cc: Lukasz Majewski <l.majewski at samsung.com>
> Cc: Minkyu Kang <mk7.kang at samsung.com>
> Cc: Scott Wood <scottwood at freescale.com>
> Cc: Vladimir Zapolskiy <vz at mleia.com>
> ---
>  drivers/mtd/nand/s3c2410_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/s3c2410_nand.c b/drivers/mtd/nand/s3c2410_nand.c
> index db87d07..399f2bc 100644
> --- a/drivers/mtd/nand/s3c2410_nand.c
> +++ b/drivers/mtd/nand/s3c2410_nand.c
> @@ -43,7 +43,7 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
>  	struct nand_chip *chip = mtd->priv;
>  	struct s3c2410_nand *nand = s3c2410_get_base_nand();
>  
> -	debug("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
> +	debug("hwcontrol(): 0x%02x 0x%08x\n", cmd & 0xff, ctrl);

What is the purpose of forcing extra zeroes in ctrl all the time?  Why is
the lack of such ugliness "just a bad idea"?

Also, the masking of cmd is an unexplained change.

-Scott


More information about the U-Boot mailing list