forked from auracaster/openocd
target: clean up return value of target_type::blank_check_memory()
The functions in struct target_type::blank_check_memory() return either an OpenOCD error or a positive value that indicates the number of blocks checked. To prevent the mix of error codes and returned values, return the value through an additional parameter 'checked' and then return ERROR_OK. While there: - change to unsigned int the parameter 'num_blocks'; - in armv7m_blank_check_memory() verify that the working area can contain at least two 'algo_block'. Change-Id: Ie22f5816819bc77ec611c3f251373d026ed9f784 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9386 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
@@ -662,8 +662,8 @@ int target_read_buffer(struct target *target,
|
||||
int target_checksum_memory(struct target *target,
|
||||
target_addr_t address, uint32_t size, uint32_t *crc);
|
||||
int target_blank_check_memory(struct target *target,
|
||||
struct target_memory_check_block *blocks, int num_blocks,
|
||||
uint8_t erased_value);
|
||||
struct target_memory_check_block *blocks, unsigned int num_blocks,
|
||||
uint8_t erased_value, unsigned int *checked);
|
||||
int target_wait_state(struct target *target, enum target_state state, unsigned int ms);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user