summaryrefslogtreecommitdiff
path: root/chip/stm32/flash-stm32h7.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/flash-stm32h7.c')
-rw-r--r--chip/stm32/flash-stm32h7.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/flash-stm32h7.c b/chip/stm32/flash-stm32h7.c
index 0f82bf409a..ba0a8a69f1 100644
--- a/chip/stm32/flash-stm32h7.c
+++ b/chip/stm32/flash-stm32h7.c
@@ -46,7 +46,7 @@
*/
#define HWBANK_SIZE (CONFIG_FLASH_SIZE / 2)
#define BLOCKS_PER_HWBANK (HWBANK_SIZE / CONFIG_FLASH_ERASE_SIZE)
-#define BLOCKS_HWBANK_MASK ((1 << BLOCKS_PER_HWBANK) - 1)
+#define BLOCKS_HWBANK_MASK (BIT(BLOCKS_PER_HWBANK) - 1)
/*
* We can tune the power consumption vs erase/write speed
@@ -358,7 +358,7 @@ int flash_physical_get_protect(int block)
int bank = block / BLOCKS_PER_HWBANK;
int index = block % BLOCKS_PER_HWBANK;
- return !(STM32_FLASH_WPSN_CUR(bank) & (1 << index));
+ return !(STM32_FLASH_WPSN_CUR(bank) & BIT(index));
}
/*