drivers: flash: Fix variable type

erase_page returns a negative value in case of error. We should
not use an unsigned type.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-03-24 23:14:37 -07:00 committed by Anas Nashif
commit 169144afa1

View file

@ -197,7 +197,8 @@ int flash_stm32_block_erase_loop(const struct device *dev,
unsigned int offset,
unsigned int len)
{
unsigned int address = offset, rc = 0;
unsigned int address = offset
int rc = 0;
for (; address <= offset + len - 1 ; address += FLASH_PAGE_SIZE) {
rc = erase_page(dev, address);