Commit 98b68324 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Thomas Bogendoerfer

firmware: bcm47xx_nvram: look for NVRAM with for instead of while

This loop requires variable initialization, stop condition and post
iteration increment. It's pretty much a for loop definition.
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 298923cf
......@@ -93,15 +93,13 @@ static int bcm47xx_nvram_find_and_copy(void __iomem *flash_start, size_t res_siz
}
/* TODO: when nvram is on nand flash check for bad blocks first. */
flash_size = FLASH_MIN;
while (flash_size <= res_size) {
for (flash_size = FLASH_MIN; flash_size <= res_size; flash_size <<= 1) {
/* Windowed flash access */
size = find_nvram_size(flash_start + flash_size);
if (size) {
offset = flash_size - size;
goto found;
}
flash_size <<= 1;
}
/* Try embedded NVRAM at 4 KB and 1 KB as last resorts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment