aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-04-23 09:39:49 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-23 09:39:49 +0100
commit986ee0139a91ab8b6b07d29d7a112c8033b5f8e0 (patch)
tree3288f237e235e05c05fcfd0c8f8ca017b334a088
parentfe224668dff97dd8899bd559d1608cc9285db67b (diff)
[MTD] Clean up AR7 partition map support
drivers/mtd/ar7part.c: In function ‘create_mtd_partitions’: drivers/mtd/ar7part.c:69: warning: passing argument 4 of ‘master->read’ from incompatible pointer type drivers/mtd/ar7part.c:91: warning: passing argument 4 of ‘master->read’ from incompatible pointer type drivers/mtd/ar7part.c:99: warning: passing argument 4 of ‘master->read’ from incompatible pointer type drivers/mtd/ar7part.c:110: warning: passing argument 4 of ‘master->read’ from incompatible pointer type drivers/mtd/ar7part.c:111: error: ‘SQUASHFS_MAGIC’ undeclared (first use in this function) drivers/mtd/ar7part.c:111: error: (Each undeclared identifier is reported only once drivers/mtd/ar7part.c:111: error: for each function it appears in.) Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r--drivers/mtd/ar7part.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c
index 7722608d5a8..ecf170b55c3 100644
--- a/drivers/mtd/ar7part.c
+++ b/drivers/mtd/ar7part.c
@@ -34,6 +34,10 @@
#define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
#define LOADER_MAGIC2 le32_to_cpu(0xfeed1281)
+#ifndef SQUASHFS_MAGIC
+#define SQUASHFS_MAGIC 0x73717368
+#endif
+
struct ar7_bin_rec {
unsigned int checksum;
unsigned int length;
@@ -47,7 +51,8 @@ static int create_mtd_partitions(struct mtd_info *master,
unsigned long origin)
{
struct ar7_bin_rec header;
- unsigned int offset, len;
+ unsigned int offset;
+ size_t len;
unsigned int pre_size = master->erasesize, post_size = 0;
unsigned int root_offset = ROOT_OFFSET;
@@ -66,7 +71,7 @@ static int create_mtd_partitions(struct mtd_info *master,
do { /* Try 10 blocks starting from master->erasesize */
offset = pre_size;
master->read(master, offset,
- sizeof(header), &len, (u8 *)&header);
+ sizeof(header), &len, (uint8_t *)&header);
if (!strncmp((char *)&header, "TIENV0.8", 8))
ar7_parts[1].offset = pre_size;
if (header.checksum == LOADER_MAGIC1)
@@ -88,7 +93,7 @@ static int create_mtd_partitions(struct mtd_info *master,
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u8 *)&header);
+ &len, (uint8_t *)&header);
}
root_offset = offset + sizeof(header) + 4;
break;
@@ -96,10 +101,10 @@ static int create_mtd_partitions(struct mtd_info *master,
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u8 *)&header);
+ &len, (uint8_t *)&header);
}
root_offset = offset + sizeof(header) + 4 + 0xff;
- root_offset &= ~(u32)0xff;
+ root_offset &= ~(uint32_t)0xff;
break;
default:
printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);