diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:54:13 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:28 +0000 |
commit | 406e8a3e929c9cef4c2a70b84710170170b7c8c9 (patch) | |
tree | 3aa91d3646d114c301db4f62219e7c85fd7a05a3 /hw/scsi | |
parent | 67ea170ee46509aa71b8227fd9521cf9c7ca0c4b (diff) |
esp.c: remove redundant n variable in PDMA COMMAND phase
This variable can be replaced by the existing len variable.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-82-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/scsi')
-rw-r--r-- | hw/scsi/esp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index ae65c2ef37..8ef6d203e0 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -427,7 +427,6 @@ static void esp_do_dma(ESPState *s) { uint32_t len, cmdlen; uint8_t buf[ESP_CMDFIFO_SZ]; - int n; len = esp_get_tc(s); @@ -494,10 +493,9 @@ static void esp_do_dma(ESPState *s) fifo8_push_all(&s->cmdfifo, buf, len); esp_set_tc(s, esp_get_tc(s) - len); } else { - n = esp_fifo_pop_buf(&s->fifo, buf, fifo8_num_used(&s->fifo)); - n = MIN(fifo8_num_free(&s->cmdfifo), n); - fifo8_push_all(&s->cmdfifo, buf, n); - + len = esp_fifo_pop_buf(&s->fifo, buf, fifo8_num_used(&s->fifo)); + len = MIN(fifo8_num_free(&s->cmdfifo), len); + fifo8_push_all(&s->cmdfifo, buf, len); esp_raise_drq(s); } trace_esp_handle_ti_cmd(cmdlen); |