From 234947d354c62381ad35b0f1a2b866b0633d419c Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:22:19 +0300 Subject: [PATCH] mspm0: Remove assert * Both conditions are true due to all calls in target_flash.c being `flash->write(..., flash->writesize)` or `flash->erase(..., flash->blocksize)` --- src/target/mspm0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/target/mspm0.c b/src/target/mspm0.c index 30903fb2bd9..23c3d86426f 100644 --- a/src/target/mspm0.c +++ b/src/target/mspm0.c @@ -23,7 +23,6 @@ #include "buffer_utils.h" #include "jep106.h" #include "cortex.h" -#include #define MSPM0_CONFIG_FLASH_DUMP_SUPPORT (CONFIG_BMDA == 1 || ENABLE_DEBUG == 1) @@ -292,8 +291,9 @@ static void mspm0_flash_unprotect_sector(target_flash_s *const target_flash, con static bool mspm0_flash_erase(target_flash_s *const target_flash, const target_addr_t addr, const size_t length) { +#ifdef DEBUG_TARGET_IS_NOOP (void)length; - assert(length == target_flash->blocksize); +#endif target_s *const target = target_flash->t; @@ -318,8 +318,9 @@ static bool mspm0_flash_erase(target_flash_s *const target_flash, const target_a static bool mspm0_flash_write( target_flash_s *const target_flash, target_addr_t dest, const void *const src, const size_t length) { +#ifdef DEBUG_TARGET_IS_NOOP (void)length; - assert(length == target_flash->writesize); +#endif target_s *const target = target_flash->t;