stm32g0: Removed some checks from the erase function which can never fire
This commit is contained in:
parent
90fc89fd63
commit
de909d96f0
|
@ -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)
|
static int stm32g0_flash_erase(target_flash_s *f, target_addr addr, size_t len)
|
||||||
{
|
{
|
||||||
target *t = f->t;
|
target *t = f->t;
|
||||||
const target_addr end = addr + len - 1U;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (end > f->start + f->length - 1U)
|
|
||||||
goto exit_error;
|
|
||||||
if (!len)
|
|
||||||
goto exit_cleanup;
|
|
||||||
|
|
||||||
/* Wait for Flash ready */
|
/* Wait for Flash ready */
|
||||||
if (!stm32g0_wait_busy(t))
|
if (!stm32g0_wait_busy(t))
|
||||||
goto exit_error;
|
goto exit_error;
|
||||||
|
|
Loading…
Reference in New Issue