[PATCH v4 2/2] hw/scsi/ncr53c710.c: Fixing Incorrect expression (IDENTICAL_BRANCHES)

Soumyajyotii Ssarkar posted 2 patches 1 week, 5 days ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>
[PATCH v4 2/2] hw/scsi/ncr53c710.c: Fixing Incorrect expression (IDENTICAL_BRANCHES)
Posted by Soumyajyotii Ssarkar 1 week, 5 days ago
The issue stems from Sync and Async if-else condition.
The same code is executed when the condition "s->waiting != NCR710_WAIT_NONE" is true or false.
Because the code in the if-then branch and after the if statement is identical
So we can remove the unnecessary condition checking for Sync and Async
cases.
As reported by: Stefan Hajnoczi <stefanha@gmail.com>

Signed-off-by: Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>
---
 hw/scsi/ncr53c710.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index 871f76c2a2..3de264fde9 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -1366,11 +1366,6 @@ again:
         case PHASE_DI:
             s->waiting = NCR710_WAIT_DMA;
             ncr710_do_dma(s, 0);
-            if (s->waiting != NCR710_WAIT_NONE) {
-                /* Async - stop and wait */
-                break;
-            }
-            /* Sync - continue execution */
             break;
         case PHASE_CO:
             ncr710_do_command(s);
-- 
2.49.0