hw/block/onenand: Remove dead code block
PATCH 1/1 hw/block/onenand: Remove dead code block
The condition of the for-loop makes sure that b is always smaller than s->blocks, so the "if (b >= s->blocks)" statement is completely superfluous here.
--- hw/block/onenand.c | 4 ---- 1 file changed, 4 deletions(-)
hw/block/onenand.c +0 -4
@@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s) s->intstatus |=ONEN_INT ;for (b =0 ; b < s->blocks; b ++) { -if (b >= s->blocks) { - s->status |=ONEN_ERR_CMD ; -break ; - }if (s->blockwp[b] ==ONEN_LOCK_LOCKTIGHTEN )break ;
Signature · 1 line
1.8.3.1
Quoted 16 lines · Thomas Huth
The condition of the for-loop makes sure that b is always smaller than
s->blocks, so the "if (b >=s->blocks)" statement is completely superfluous here.Signed-off-by Thomas Huth <[email protected]>--- hw/block/onenand.c | 4 ---- 1 file changed, 4 deletions(-)hw/block/onenand.c +0
-0
hw/block/onenand.c static void onenand_command(OneNANDState *s) · line 525
Quoted 10 lines
hw/block/onenand.c +0
-4@@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s) s->intstatus |=ONEN_INT ;for (b =0 ; b < s->blocks; b ++) { -if (b >= s->blocks) { - s->status |=ONEN_ERR_CMD ; -break ; - }if (s->blockwp[b] ==ONEN_LOCK_LOCKTIGHTEN )break ;
Looks like a bad cut'n'paste from case 0x23.
Kevin Wolf
AppliedAm 03.10.2017 um 12:25 hat Laurent Vivier geschrieben:
Quoted 30 lines · Thomas Huth
Quoted 16 lines
The condition of the for-loop makes sure that b is always smaller than
s->blocks, so the "if (b >=s->blocks)" statement is completely superfluous here.Signed-off-by Thomas Huth <[email protected]>--- hw/block/onenand.c | 4 ---- 1 file changed, 4 deletions(-)hw/block/onenand.c +0
-0hw/block/onenand.c static void onenand_command(OneNANDState *s) · line 525
Quoted 10 lines
hw/block/onenand.c +0
-4@@ -520,10 +520,6 @@ static void onenand_command(OneNANDState *s) s->intstatus |=ONEN_INT ;for (b =0 ; b < s->blocks; b ++) { -if (b >= s->blocks) { - s->status |=ONEN_ERR_CMD ; -break ; - }if (s->blockwp[b] ==ONEN_LOCK_LOCKTIGHTEN )break ;Looks like a bad cut'n'paste from case
0x23.
Quoted 1 line
Reviewed-by Laurent Vivier <[email protected]>
Thanks, applied to the block branch.
Kevin