diff mbox series

[v3,2/2] scsi: lsi: use macro LSI_MAX_INSN instead of a magic number

Message ID 20190809063835.6717-3-ppandit@redhat.com (mailing list archive)
State New, archived
Headers show
Series scsi: lsi: break infinite loop after 10k instructions | expand

Commit Message

Prasad Pandit Aug. 9, 2019, 6:38 a.m. UTC
From: Prasad J Pandit <pjp@fedoraproject.org>

Use macro 'LSI_MAX_INSN' instead of a magic number 10000.

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 hw/scsi/lsi53c895a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index e703ef4c9d..f6786607f8 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1578,7 +1578,7 @@  again:
             }
         }
     }
-    if (insn_processed > 10000 && s->waiting == LSI_NOWAIT) {
+    if (insn_processed > LSI_MAX_INSN && s->waiting == LSI_NOWAIT) {
         /* Some windows drivers make the device spin waiting for a memory
            location to change.  If we have been executed a lot of code then
            assume this is the case and force an unexpected device disconnect.