stm32: remove redundant 'else if'
Subsystems (3)
PATCH 1/1 stm32: remove redundant 'else if'
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 <[email protected]>
--- arch/arm/mach-stm32/stm32f1/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32/stm32f1/flash.c +1 -1
@@ -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 ;
Signature · 1 line
2.13.2
PATCH 1/1 stm32: remove redundant 'else if'
Quoted 6 lines · xypron.glpk at gmx.de
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170813/c680fd29/attachment.sig>