]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
dma: Have dma_buf_rw() take a void pointer
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 16 Dec 2021 10:24:56 +0000 (11:24 +0100)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 30 Dec 2021 16:16:32 +0000 (17:16 +0100)
DMA operations are run on any kind of buffer, not arrays of
uint8_t. Convert dma_buf_rw() to take a void pointer argument
to save us pointless casts to uint8_t *.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211223115554.3155328-8-philmd@redhat.com>

softmmu/dma-helpers.c

index 3c06a2feddda3de548252e0d6bcb00173266cd26..09e29997ee51ec22b4bee0ded9bebf2484151bf9 100644 (file)
@@ -294,9 +294,10 @@ BlockAIOCB *dma_blk_write(BlockBackend *blk,
 }
 
 
-static uint64_t dma_buf_rw(uint8_t *ptr, int32_t len, QEMUSGList *sg,
+static uint64_t dma_buf_rw(void *buf, int32_t len, QEMUSGList *sg,
                            DMADirection dir)
 {
+    uint8_t *ptr = buf;
     uint64_t resid;
     int sg_cur_index;