Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4048
b: refs/heads/master
c: 747aead
h: refs/heads/master
v: v3
  • Loading branch information
Catalin Marinas authored and Russell King committed Jun 30, 2005
1 parent 5aea849 commit 243c6a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: abaf48a05a8f097654e746af2a5afb2ab95861a1
refs/heads/master: 747aead34de65c25765da79825ce2c08d8257b10
16 changes: 2 additions & 14 deletions trunk/drivers/mtd/afs.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
*/
for (idx = off = 0; off < mtd->size; off += mtd->erasesize) {
struct image_info_struct iis;
u_int iis_ptr, img_ptr, size;
u_int iis_ptr, img_ptr;

/* Read the footer. */
ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
Expand All @@ -236,21 +236,9 @@ static int parse_afs_partitions(struct mtd_info *mtd,
continue;

strcpy(str, iis.name);
size = mtd->erasesize + off - img_ptr;

/*
* In order to support JFFS2 partitions on this layout,
* we must lie to MTD about the real size of JFFS2
* partitions; this ensures that the AFS flash footer
* won't be erased by JFFS2. Please ensure that your
* JFFS2 partitions are given image numbers between
* 1000 and 2000 inclusive.
*/
if (iis.imageNumber >= 1000 && iis.imageNumber < 2000)
size -= mtd->erasesize;

parts[idx].name = str;
parts[idx].size = size;
parts[idx].size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1);
parts[idx].offset = img_ptr;
parts[idx].mask_flags = 0;

Expand Down

0 comments on commit 243c6a3

Please sign in to comment.