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-Url: https://git.gag.com/?a=commitdiff_plain;h=cba1813d5c017e2d20969bb419a856fe15c5ceef;p=fw%2Fopenocd 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 5eb51cd2d..01088f3c1 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++) {