summaryrefslogtreecommitdiff
path: root/drivers/firmware/broadcom/bcm47xx_nvram.c
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-03-08 12:03:19 +0300
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-03-12 17:53:07 +0300
commit98b68324f67236e8c9152976535dc1f27fb67ba8 (patch)
treeebe33dcda05eae22a7b1530242eb07f217d65c14 /drivers/firmware/broadcom/bcm47xx_nvram.c
parent298923cf999cecd2ef06df126f85a3d68da8c4d8 (diff)
downloadlinux-98b68324f67236e8c9152976535dc1f27fb67ba8.tar.xz
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: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'drivers/firmware/broadcom/bcm47xx_nvram.c')
-rw-r--r--drivers/firmware/broadcom/bcm47xx_nvram.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/firmware/broadcom/bcm47xx_nvram.c b/drivers/firmware/broadcom/bcm47xx_nvram.c
index 09f51b95849e..1d2271b1e07a 100644
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
@@ -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 */