aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-12-31 11:13:34 +0100
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2022-01-18 12:56:29 +0100
commit5f412602ded57bbdce614685eba915f6042dda1d (patch)
tree2078f9c06df35abc137c9bb4620c52c9ddd02311 /softmmu
parentce0a7982855afd873600a4180161adbfaef24cc1 (diff)
downloadqemu-5f412602ded57bbdce614685eba915f6042dda1d.zip
qemu-5f412602ded57bbdce614685eba915f6042dda1d.tar.gz
qemu-5f412602ded57bbdce614685eba915f6042dda1d.tar.bz2
hw/scsi: Rename SCSIRequest::resid as 'residual'
The 'resid' field is slightly confusing and could be interpreted as some ID. Rename it as 'residual' which is clearer to review. No logical change. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Message-Id: <20220111184309.28637-8-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/dma-helpers.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c
index b0be156..4563a77 100644
--- a/softmmu/dma-helpers.c
+++ b/softmmu/dma-helpers.c
@@ -294,49 +294,49 @@ BlockAIOCB *dma_blk_write(BlockBackend *blk,
}
-static MemTxResult dma_buf_rw(void *buf, int32_t len, uint64_t *residp,
+static MemTxResult dma_buf_rw(void *buf, int32_t len, uint64_t *residual,
QEMUSGList *sg, DMADirection dir,
MemTxAttrs attrs)
{
uint8_t *ptr = buf;
- uint64_t resid;
+ uint64_t xresidual;
int sg_cur_index;
MemTxResult res = MEMTX_OK;
- resid = sg->size;
+ xresidual = sg->size;
sg_cur_index = 0;
- len = MIN(len, resid);
+ len = MIN(len, xresidual);
while (len > 0) {
ScatterGatherEntry entry = sg->sg[sg_cur_index++];
int32_t xfer = MIN(len, entry.len);
res |= dma_memory_rw(sg->as, entry.base, ptr, xfer, dir, attrs);
ptr += xfer;
len -= xfer;
- resid -= xfer;
+ xresidual -= xfer;
}
- if (residp) {
- *residp = resid;
+ if (residual) {
+ *residual = xresidual;
}
return res;
}
uint64_t dma_buf_read(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs)
{
- uint64_t resid;
+ uint64_t residual;
- dma_buf_rw(ptr, len, &resid, sg, DMA_DIRECTION_FROM_DEVICE, attrs);
+ dma_buf_rw(ptr, len, &residual, sg, DMA_DIRECTION_FROM_DEVICE, attrs);
- return resid;
+ return residual;
}
uint64_t dma_buf_write(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs)
{
- uint64_t resid;
+ uint64_t residual;
- dma_buf_rw(ptr, len, &resid, sg, DMA_DIRECTION_TO_DEVICE, attrs);
+ dma_buf_rw(ptr, len, &residual, sg, DMA_DIRECTION_TO_DEVICE, attrs);
- return resid;
+ return residual;
}
void dma_acct_start(BlockBackend *blk, BlockAcctCookie *cookie,