[PATCH 13/16] ncr710: do not load s->current in advance

Paolo Bonzini posted 16 patches 5 days, 16 hours ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>
[PATCH 13/16] ncr710: do not load s->current in advance
Posted by Paolo Bonzini 5 days, 16 hours ago
It is unnnecessary and potentially could use stale data.  Load
s->current just before use.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/ncr53c710.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index f768ad74237..298e0317b70 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -1040,8 +1040,6 @@ static void ncr710_do_msgin(NCR710State *s)
 
 static void ncr710_do_msgout(NCR710State *s)
 {
-    NCR710Request *current_req = s->current;
-
     while (s->dbc > 0) {
         int to_move = MIN((int)s->dbc, NCR710_SCSI_FIFO_SIZE);
         uint8_t temp_buf[NCR710_SCSI_FIFO_SIZE];
@@ -1169,8 +1167,8 @@ static void ncr710_do_msgout(NCR710State *s)
                 break;
 
             case 0x0d: /* ABORT TAG */
-                if (current_req) {
-                    scsi_req_cancel(current_req->req);
+                if (s->current) {
+                    scsi_req_cancel(s->current->req);
                 }
                 ncr710_disconnect(s);
                 break;
-- 
2.53.0