Commit 06503f16c34b722ed07cda98aa6e268941c4dd46

Authored by Scott Wood
Committed by Tom Rini
1 parent 6d5ce1bd00

mtd: fix warnings due to 64-bit partition support

commit 39ac34473f3c96e77cbe03a49141771ed1639486 ("cmd_mtdparts: use 64
bits for flash size, partition size & offset") introduced warnings
in a couple places due to printf formats or pointer casting.

This patch fixes the warnings pointed out here:
http://lists.denx.de/pipermail/u-boot/2013-October/164981.html

Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: York Sun <yorksun@freescale.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Tom Rini <trini@ti.com>

Showing 2 changed files with 5 additions and 4 deletions Side-by-side Diff

common/fdt_support.c
... ... @@ -766,11 +766,11 @@
766 766  
767 767 part = list_entry(pentry, struct part_info, link);
768 768  
769   - debug("%2d: %-20s0x%08x\t0x%08x\t%d\n",
  769 + debug("%2d: %-20s0x%08llx\t0x%08llx\t%d\n",
770 770 part_num, part->name, part->size,
771 771 part->offset, part->mask_flags);
772 772  
773   - sprintf(buf, "partition@%x", part->offset);
  773 + sprintf(buf, "partition@%llx", part->offset);
774 774 add_sub:
775 775 ret = fdt_add_subnode(blob, parent_offset, buf);
776 776 if (ret == -FDT_ERR_NOSPACE) {
... ... @@ -43,9 +43,10 @@
43 43 * device address space offset, so we need to shift it by a device start address. */
44 44 #if !defined(CONFIG_SYS_NO_FLASH)
45 45 extern flash_info_t flash_info[];
46   -#define PART_OFFSET(x) (x->offset + flash_info[x->dev->id->num].start[0])
  46 +#define PART_OFFSET(x) ((ulong)x->offset + \
  47 + flash_info[x->dev->id->num].start[0])
47 48 #else
48   -#define PART_OFFSET(x) (x->offset)
  49 +#define PART_OFFSET(x) ((ulong)x->offset)
49 50 #endif
50 51  
51 52 static int cramfs_read_super (struct part_info *info)