From: Piotr Esden-Tempski Date: Mon, 28 Dec 2009 15:43:51 +0000 (+0100) Subject: NOR: last_addr also needs correction when checking alignment X-Git-Tag: v0.4.0-rc2~183 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=cba1813d5c017e2d20969bb419a856fe15c5ceef NOR: last_addr also needs correction when checking alignment Otherwise the new alignment checking algorithm thinks that the address is not aligned, because it is way beyond the last sector. Signed-off-by: David Brownell --- diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index 5eb51cd2da..01088f3c14 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -316,6 +316,7 @@ static int flash_iterate_address_range(struct target *target, /** @todo: handle erasures that cross into adjacent banks */ addr -= c->base; + last_addr -= c->base; for (i = 0; i < c->num_sectors; i++) {