[U-Boot] [PATCH 3/3] [OneNAND] Flex-OneNAND boundary settings

Scott Wood scottwood at freescale.com
Mon Nov 9 21:02:22 CET 2009


On Fri, Nov 06, 2009 at 05:17:44PM +0530, Amul Kumar Saha wrote:
> -			printk("Bad blocks %d at 0x%x\n",
> -			       (u32)(ofs >> this->erase_shift), (u32)ofs);
> +			printk("Bad blocks %lu at 0x%x\n",
> +			       (u32)onenand_block(this, ofs), (u32)ofs);

cmd_onenand.c: In function ‘onenand_block_read’:
cmd_onenand.c:103: warning: format ‘%lu’ expects type ‘long unsigned int’,
but argument 2 has type ‘unsigned int’

If you must pass a u32 to printf, use "%u" or "%x" -- but it makes little
sense to explicitly cast from int to something that doesn't have a standard
printf format string.

How about this?

+			printk("Bad block %d at 0x%llx\n",
+			       onenand_block(this, ofs), ofs);

Likewise throughout the rest of the file.

-Scott


More information about the U-Boot mailing list