Skip to contentSkip to conversation

mtd: fix warnings due to 64-bit partition support

PATCH In review Scott Wood 4 participants 4 messages Oct 15, 2013 – Oct 16, 2013 Cramfs filesystem

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 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

Cc York Sun <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Paul Burton <[email protected]>
Cc Tom Rini <[email protected]>

---
Alternatively, given the imminent release, perhaps all but the first patch of my recent NAND pull request should be reverted. The first patch was a regression fix, but on a second look the remaining patches look more like enabling a new feature (and I didn't look too closely at the ubi patches because Stefan had acked them and asked me to apply; patch 4 is clearly not a bugfix).

I'm not sure why I didn't catch these warnings as I did run a makeall on arm and ppc. The only thing I can guess is that I forgot to check the ppc results, or I missed them among other pre-existing warnings such as the "AltiVec not supported in this target" warnings I get from 86xx builds.

---
 common/fdt_support.c | 4 ++--
 fs/cramfs/cramfs.c   | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
common/fdt_support.c +2 -2
index b034c98..1f0d8f5 100644
@@ -766,11 +766,11 @@ int fdt_node_set_part_info(void *blob, int parent_offset,
 
 		part = list_entry(pentry, struct part_info, link);
 
-		debug("%2d: %-20s0x%08x\t0x%08x\t%d\n",
+		debug("%2d: %-20s0x%08llx\t0x%08llx\t%d\n",
 			part_num, part->name, part->size,
 			part->offset, part->mask_flags);
 
-		sprintf(buf, "partition@%x", part->offset);
+		sprintf(buf, "partition@%llx", part->offset);
 add_sub:
 		ret = fdt_add_subnode(blob, parent_offset, buf);
 		if (ret == -FDT_ERR_NOSPACE) {
fs/cramfs/cramfs.c +3 -2
index e578a1e..fd8e4ef 100644
@@ -43,9 +43,10 @@ struct cramfs_super super;
  * device address space offset, so we need to shift it by a device start address. */
 #if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
-#define PART_OFFSET(x)	(x->offset + flash_info[x->dev->id->num].start[0])
+#define PART_OFFSET(x)	((ulong)x->offset + \
+			 flash_info[x->dev->id->num].start[0])
 #else
-#define PART_OFFSET(x)	(x->offset)
+#define PART_OFFSET(x)	((ulong)x->offset)
 #endif
 
 static int cramfs_read_super (struct part_info *info)
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 4 lines · Scott Wood

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.

Quoted 8 lines

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

Cc York Sun <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Paul Burton <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131015/2db87cdb/attachment.pgp>
#2 lore raw

PATCH 1/1 mtd: fix warnings due to 64-bit partition support

In reply to Scott Wood

Hi Scott,

Quoted 4 lines · Scott Wood

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.

Quoted 8 lines

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

Cc York Sun <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Paul Burton <[email protected]>
Cc Tom Rini <[email protected]>
Quoted 7 lines

---
Alternatively, given the imminent release, perhaps all but the first patch of my recent NAND pull request should be reverted. The first patch was a regression fix, but on a second look the remaining patches look more like enabling a new feature (and I didn't look too closely at the ubi patches because Stefan had acked them and asked me to apply; patch 4 is clearly not a bugfix).

Yes. But the first version of this patchset was posted before the merge window was closed (on the 6th of August). So they should be integrated in this release. That was my reasoning.

Thanks,
Stefan

#3 lore raw

PATCH 1/1 mtd: fix warnings due to 64-bit partition support

Quoted 26 lines · Stefan Roese

Hi Scott,

Quoted 4 lines · Scott Wood

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.

Quoted 8 lines

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

Cc York Sun <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Paul Burton <[email protected]>
Cc Tom Rini <[email protected]>
Quoted 7 lines

---
Alternatively, given the imminent release, perhaps all but the first patch of my recent NAND pull request should be reverted. The first patch was a regression fix, but on a second look the remaining patches look more like enabling a new feature (and I didn't look too closely at the ubi patches because Stefan had acked them and asked me to apply; patch 4 is clearly not a bugfix).

Quoted 7 lines

Yes. But the first version of this patchset was posted before the merge window was closed (on the 6th of August). So they should be integrated in this release. That was my reasoning.

Thanks,
Stefan

Thanks for catching & fixing this guys :)

I'll make sure to build all boards when touching non-board-specific code in future!

Paul