From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Jackson Date: Wed, 11 Mar 2009 09:54:20 +0000 Subject: [U-Boot] [PATCH 1/1] Fix JFFS2 NOR sector size routine Message-ID: <49B78A4C.204@mimc.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch fixes the JFFS2 scanning code when not using CONFIG_JFFS2_CMDLINE. Signed-off-by: Mark Jackson --- 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)