Skip to content

Commit 7d3b846

Browse files
tom-vanerhankur
authored andcommitted
flash/nor/nrf5: drop useless for cycle condition
Commit [1] added a break on error to the nrf5_erase() sector loop and the checking of the res value became useless in the for loop condition. Removing nrf5_get_probed_chip_if_halted() later in [2] dropped res initialization and clang static analyser complains "The left operand of '==' is a garbage value" Drop the useless test! Fixes: [1] commit 491636c ("flash/nor/nrf5: check protection before flash erase/write on nRF51") Fixes: [2] commit 2db325f ("flash/nor/nrf5: drop nrf5_get_probed_chip_if_halted()") Signed-off-by: Tomas Vanek <[email protected]> Change-Id: Ife6071c509719f8d7dc312fe9a780bdcf2575f69 Reviewed-on: https://review.openocd.org/c/openocd/+/8174 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
1 parent 61ec2f6 commit 7d3b846

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/flash/nor/nrf5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static int nrf5_erase(struct flash_bank *bank, unsigned int first,
10711071
}
10721072

10731073
/* For each sector to be erased */
1074-
for (unsigned int s = first; s <= last && res == ERROR_OK; s++) {
1074+
for (unsigned int s = first; s <= last; s++) {
10751075

10761076
if (chip->features & NRF5_FEATURE_SERIES_51
10771077
&& bank->sectors[s].is_protected == 1) {

0 commit comments

Comments
 (0)