From de909d96f051876b2df37bbc773d168f7c9befbc Mon Sep 17 00:00:00 2001 From: dragonmux Date: Tue, 9 Aug 2022 20:40:33 +0100 Subject: [PATCH] stm32g0: Removed some checks from the erase function which can never fire --- src/target/stm32g0.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/target/stm32g0.c b/src/target/stm32g0.c index d96878b..9905c06 100644 --- a/src/target/stm32g0.c +++ b/src/target/stm32g0.c @@ -336,14 +336,8 @@ static bool stm32g0_wait_busy(target *const t) static int stm32g0_flash_erase(target_flash_s *f, target_addr addr, size_t len) { target *t = f->t; - const target_addr end = addr + len - 1U; int ret = 0; - if (end > f->start + f->length - 1U) - goto exit_error; - if (!len) - goto exit_cleanup; - /* Wait for Flash ready */ if (!stm32g0_wait_busy(t)) goto exit_error;