diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-03-04 22:10:41 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2021-03-07 10:39:05 +0000 |
commit | cfcea0f9d76f56d1a756a5ead28f5a8900b750e3 (patch) | |
tree | 28136983bc94c9f1731de3f9232ea9152f912926 /hw/scsi/esp.c | |
parent | c959f218437c8828490267d42f42f9aa851dd8ea (diff) | |
download | qemu-cfcea0f9d76f56d1a756a5ead28f5a8900b750e3.zip qemu-cfcea0f9d76f56d1a756a5ead28f5a8900b750e3.tar.gz qemu-cfcea0f9d76f56d1a756a5ead28f5a8900b750e3.tar.bz2 |
esp: remove the buf and buflen parameters from get_cmd()
Now that all SCSI commands are accumulated in cmdbuf, remove the buf and buflen
parameters from get_cmd() since these always reference cmdbuf and ESP_CMDBUF_SZ
respectively.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-21-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/scsi/esp.c')
-rw-r--r-- | hw/scsi/esp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 8ebf5e8..44fddf0 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -236,15 +236,16 @@ static int get_cmd_cb(ESPState *s) return 0; } -static uint32_t get_cmd(ESPState *s, uint8_t *buf, uint8_t buflen) +static uint32_t get_cmd(ESPState *s) { + uint8_t *buf = s->cmdbuf; uint32_t dmalen; int target; target = s->wregs[ESP_WBUSID] & BUSID_DID; if (s->dma) { dmalen = esp_get_tc(s); - if (dmalen > buflen) { + if (dmalen > ESP_CMDBUF_SZ) { return 0; } if (s->dma_memory_read) { @@ -323,7 +324,7 @@ static void handle_satn(ESPState *s) return; } s->pdma_cb = satn_pdma_cb; - s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf)); + s->cmdlen = get_cmd(s); if (s->cmdlen) { do_cmd(s); } else { @@ -349,7 +350,7 @@ static void handle_s_without_atn(ESPState *s) return; } s->pdma_cb = s_without_satn_pdma_cb; - s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf)); + s->cmdlen = get_cmd(s); if (s->cmdlen) { do_busid_cmd(s, s->cmdbuf, 0); } else { @@ -380,7 +381,7 @@ static void handle_satn_stop(ESPState *s) return; } s->pdma_cb = satn_stop_pdma_cb; - s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf)); + s->cmdlen = get_cmd(s); if (s->cmdlen) { trace_esp_handle_satn_stop(s->cmdlen); s->do_cmd = 1; |