Fix JFFS2 NOR sector size routine
PATCH 1/1 Fix JFFS2 NOR sector size routine
This patch fixes the JFFS2 scanning code when not using CONFIG_JFFS2_CMDLINE.
--- common/cmd_jffs2.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
common/cmd_jffs2.c +0 -0
@@ -1814,7 +1814,12 @@ static inline u32 get_part_sector_size_nor(struct
mtdids *id, struct part_info *
flash = &flash_info[id->num];
start_phys = flash->start[0] + part->offset;
- end_phys = start_phys + part->size;
+
+ if (part->size == SIZE_REMAINING) {
+ end_phys = start_phys + flash->size;
+ } else {
+ end_phys = start_phys + part->size;
+ }
for (i = 0; i < flash->sector_count; i++) {
if (flash->start[i] >= end_phys)PATCH 1/1 Fix JFFS2 NOR sector size routine
Quoted 9 lines · Mark Jackson
common/cmd_jffs2.c +0
-0@@ -1814,7 +1814,12 @@ static inline u32 get_part_sector_size_nor(structmtdids *id, struct
part_info*
flash = &flash_info[id->num];start_phys = flash->start[0] + part->offset;
common/cmd_jffs2.c
Quoted 7 lines
common/cmd_jffs2.c +6
-1- end_phys = start_phys + part->size; + +if (part->size ==SIZE_REMAINING ) { + end_phys = start_phys + flash->size; + }else { + end_phys = start_phys + part->size; + }
That looks wrong if part->offset != 0; shouldn't it be:
if (part->size == SIZE_REMAINING)
end_phys = flash->start[0] + flash->size; else end_phys = start_phys + part->size;
?
-Scott
PATCH 1/1 Fix JFFS2 NOR sector size routine
Quoted 20 lines · Scott Wood
Quoted 9 lines · Mark Jackson
common/cmd_jffs2.c +0
-0@@ -1814,7 +1814,12 @@ static inline u32 get_part_sector_size_nor(structmtdids *id, struct
part_info*
flash =&flash_info[id->num];start_phys = flash->start[0] + part->offset;common/cmd_jffs2.c
Quoted 7 lines
common/cmd_jffs2.c +6
-1- end_phys = start_phys + part->size; + +if (part->size ==SIZE_REMAINING ) { + end_phys = start_phys + flash->size; + }else { + end_phys = start_phys + part->size; + }That looks wrong if
part->offset!= 0; shouldn't it be:
Quoted 8 lines
if (
part->size==SIZE_REMAINING)end_phys = flash->start[0] + flash->size; else end_phys = start_phys + part->size;?
-Scott
Yes ... that seems perfectly reasonable !!
I'll update my patch, retest and resubmit.
Thanks
Mark