[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/8] dma: Have dma_buf_rw() take a void pointer
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 1/8] dma: Have dma_buf_rw() take a void pointer |
Date: |
Thu, 16 Dec 2021 13:35:51 +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 *.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
softmmu/dma-helpers.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c
index 3c06a2feddd..09e29997ee5 100644
--- a/softmmu/dma-helpers.c
+++ b/softmmu/dma-helpers.c
@@ -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;
--
2.33.1
- [PATCH 0/8] hw: Have DMA API take MemTxAttrs arg & propagate MemTxResult (part 2), Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 2/8] dma: Have dma_buf_read() / dma_buf_write() take a void pointer, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 1/8] dma: Have dma_buf_rw() take a void pointer,
Philippe Mathieu-Daudé <=
- [PATCH 3/8] dma: Let pci_dma_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 4/8] dma: Let dma_buf_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 5/8] dma: Let dma_buf_write() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 6/8] dma: Let dma_buf_read() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 7/8] dma: Let dma_buf_rw() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/16
- [PATCH 8/8] dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/16
- Re: [PATCH 0/8] hw: Have DMA API take MemTxAttrs arg & propagate MemTxResult (part 2), Klaus Jensen, 2021/12/16
- Re: [PATCH 0/8] hw: Have DMA API take MemTxAttrs arg & propagate MemTxResult (part 2), John Snow, 2021/12/16