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 <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2018-03-07 13:23:08 +01:00 committed by Carles Cufí
commit 51527e07ef

View file

@ -79,7 +79,7 @@ void flash_area_close(const struct flash_area *fa)
static struct device *get_flash_dev_from_id(u8_t id)
{
for (int i = 0; i < ARRAY_SIZE(flash_drivers_map); i++) {
for (unsigned int i = 0; i < ARRAY_SIZE(flash_drivers_map); i++) {
if (flash_drivers_map[i].id == id) {
return flash_dev[i];
}
@ -266,7 +266,7 @@ u8_t flash_area_align(const struct flash_area *fa)
static int flash_map_init(struct device *dev)
{
int i;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(flash_dev); i++) {
flash_dev[i] = device_get_binding(flash_drivers_map[i].name);