Skip to content

Commit 201e52f

Browse files
jasowangmstsirkin
authored andcommitted
virtio_ring: rename dma_handle to map_handle
Following patch will introduce virtio map operations which means the address is not necessarily used for DMA. Let's rename the dma_handle to map_handle first. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20250821064641.5025-6-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
1 parent b16060c commit 201e52f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/virtio/virtio_ring.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,18 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev)
305305
EXPORT_SYMBOL_GPL(virtio_max_dma_size);
306306

307307
static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
308-
dma_addr_t *dma_handle, gfp_t flag,
308+
dma_addr_t *map_handle, gfp_t flag,
309309
union virtio_map map)
310310
{
311311
if (vring_use_map_api(vdev)) {
312312
return dma_alloc_coherent(map.dma_dev, size,
313-
dma_handle, flag);
313+
map_handle, flag);
314314
} else {
315315
void *queue = alloc_pages_exact(PAGE_ALIGN(size), flag);
316316

317317
if (queue) {
318318
phys_addr_t phys_addr = virt_to_phys(queue);
319-
*dma_handle = (dma_addr_t)phys_addr;
319+
*map_handle = (dma_addr_t)phys_addr;
320320

321321
/*
322322
* Sanity check: make sure we dind't truncate
@@ -329,7 +329,7 @@ static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
329329
* warning and abort if we end up with an
330330
* unrepresentable address.
331331
*/
332-
if (WARN_ON_ONCE(*dma_handle != phys_addr)) {
332+
if (WARN_ON_ONCE(*map_handle != phys_addr)) {
333333
free_pages_exact(queue, PAGE_ALIGN(size));
334334
return NULL;
335335
}
@@ -339,11 +339,11 @@ static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
339339
}
340340

341341
static void vring_free_queue(struct virtio_device *vdev, size_t size,
342-
void *queue, dma_addr_t dma_handle,
342+
void *queue, dma_addr_t map_handle,
343343
union virtio_map map)
344344
{
345345
if (vring_use_map_api(vdev))
346-
dma_free_coherent(map.dma_dev, size, queue, dma_handle);
346+
dma_free_coherent(map.dma_dev, size, queue, map_handle);
347347
else
348348
free_pages_exact(queue, PAGE_ALIGN(size));
349349
}

0 commit comments

Comments
 (0)