mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument
Various APIs use 'pval' naming for 'pointer to val'. rdma_pci_dma_map() uses 'plen' for 'PCI length', but since 'PCI' is already explicit in the function name, simplify and rename the argument 'len'. 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> Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com> Tested-by: Yuval Shaia <yuval.shaia.ml@gmail.com> Message-Id: <20220111184309.28637-7-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
fd5e451edb
commit
ce0a798285
@ -17,29 +17,29 @@
|
||||
#include "trace.h"
|
||||
#include "rdma_utils.h"
|
||||
|
||||
void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen)
|
||||
void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t len)
|
||||
{
|
||||
void *p;
|
||||
hwaddr len = plen;
|
||||
hwaddr pci_len = len;
|
||||
|
||||
if (!addr) {
|
||||
rdma_error_report("addr is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = pci_dma_map(dev, addr, &len, DMA_DIRECTION_TO_DEVICE);
|
||||
p = pci_dma_map(dev, addr, &pci_len, DMA_DIRECTION_TO_DEVICE);
|
||||
if (!p) {
|
||||
rdma_error_report("pci_dma_map fail, addr=0x%"PRIx64", len=%"PRId64,
|
||||
addr, len);
|
||||
addr, pci_len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (len != plen) {
|
||||
rdma_pci_dma_unmap(dev, p, len);
|
||||
if (pci_len != len) {
|
||||
rdma_pci_dma_unmap(dev, p, pci_len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
trace_rdma_pci_dma_map(addr, p, len);
|
||||
trace_rdma_pci_dma_map(addr, p, pci_len);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ typedef struct RdmaProtectedGSList {
|
||||
GSList *list;
|
||||
} RdmaProtectedGSList;
|
||||
|
||||
void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen);
|
||||
void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t len);
|
||||
void rdma_pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t len);
|
||||
void rdma_protected_gqueue_init(RdmaProtectedGQueue *list);
|
||||
void rdma_protected_gqueue_destroy(RdmaProtectedGQueue *list);
|
||||
|
Loading…
Reference in New Issue
Block a user