* [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine
@ 2009-03-11 9:54 Mark Jackson
2009-03-11 18:29 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Mark Jackson @ 2009-03-11 9:54 UTC (permalink / raw)
To: u-boot
This patch fixes the JFFS2 scanning code when not using
CONFIG_JFFS2_CMDLINE.
Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
---
common/cmd_jffs2.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index d0a7cea..2f3b3a9 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -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)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine
2009-03-11 9:54 [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine Mark Jackson
@ 2009-03-11 18:29 ` Scott Wood
2009-03-12 9:12 ` Mark Jackson
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2009-03-11 18:29 UTC (permalink / raw)
To: u-boot
On Wed, Mar 11, 2009 at 09:54:20AM +0000, Mark Jackson wrote:
> diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
> index d0a7cea..2f3b3a9 100644
> --- a/common/cmd_jffs2.c
> +++ b/common/cmd_jffs2.c
> @@ -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;
> + }
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine
2009-03-11 18:29 ` Scott Wood
@ 2009-03-12 9:12 ` Mark Jackson
0 siblings, 0 replies; 3+ messages in thread
From: Mark Jackson @ 2009-03-12 9:12 UTC (permalink / raw)
To: u-boot
On 11/03/09 18:29, Scott Wood wrote:
> On Wed, Mar 11, 2009 at 09:54:20AM +0000, Mark Jackson wrote:
>> diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
>> index d0a7cea..2f3b3a9 100644
>> --- a/common/cmd_jffs2.c
>> +++ b/common/cmd_jffs2.c
>> @@ -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;
>> + }
>
> 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
Yes ... that seems perfectly reasonable !!
I'll update my patch, retest and resubmit.
Thanks
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-12 9:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 9:54 [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine Mark Jackson
2009-03-11 18:29 ` Scott Wood
2009-03-12 9:12 ` Mark Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox