Skip to content

Commit

Permalink
drivers: flash: Fix variable type
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Flavio Ceolin authored and nashif committed Mar 26, 2021
1 parent 799147f commit 169144a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/flash/flash_stm32g4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 169144a

Please sign in to comment.