Skip to content

Commit 51527e0

Browse files
nvlsianpucarlescufi
authored andcommitted
subsys: storage: flash_map: Fix Coverity issues
Loop counter was type of signed int while it was compared to unsigned lvalue in loop condition. Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 6db7b43 commit 51527e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/storage/flash_map/flash_map.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void flash_area_close(const struct flash_area *fa)
7979

8080
static struct device *get_flash_dev_from_id(u8_t id)
8181
{
82-
for (int i = 0; i < ARRAY_SIZE(flash_drivers_map); i++) {
82+
for (unsigned int i = 0; i < ARRAY_SIZE(flash_drivers_map); i++) {
8383
if (flash_drivers_map[i].id == id) {
8484
return flash_dev[i];
8585
}
@@ -266,7 +266,7 @@ u8_t flash_area_align(const struct flash_area *fa)
266266

267267
static int flash_map_init(struct device *dev)
268268
{
269-
int i;
269+
unsigned int i;
270270

271271
for (i = 0; i < ARRAY_SIZE(flash_dev); i++) {
272272
flash_dev[i] = device_get_binding(flash_drivers_map[i].name);

0 commit comments

Comments
 (0)