diff mbox

[U-Boot,1/1] stm32: remove redundant 'else if'

Message ID 20170730184605.9594-1-xypron.glpk@gmx.de
State Accepted
Commit d1fe19766bc2a4c065b29a5617472c66a2696a67
Delegated to: Tom Rini
Headers show

Commit Message

Heinrich Schuchardt July 30, 2017, 6:46 p.m. UTC
The if in the else branch is superfluous.
We can use a simple if.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/arm/mach-stm32/stm32f1/flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Aug. 14, 2017, 12:07 a.m. UTC | #1
On Sun, Jul 30, 2017 at 08:46:05PM +0200, xypron.glpk@gmx.de wrote:

> The if in the else branch is superfluous.
> We can use a simple if.
> 
> The problem was indicated by cppcheck.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/arch/arm/mach-stm32/stm32f1/flash.c b/arch/arm/mach-stm32/stm32f1/flash.c
index 7d41f63733..9dc8e1198f 100644
--- a/arch/arm/mach-stm32/stm32f1/flash.c
+++ b/arch/arm/mach-stm32/stm32f1/flash.c
@@ -49,7 +49,7 @@  unsigned long flash_init(void)
 	if (size <= STM32_MAX_BANK) {
 		banks = 1;
 		flash_info[0].sector_count = size >> 1;
-	} else if (size > STM32_MAX_BANK) {
+	} else {
 		banks = 2;
 		flash_info[0].sector_count = STM32_MAX_BANK >> 1;
 		flash_info[1].sector_count = (size - STM32_MAX_BANK) >> 1;