Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6fa0dc8 authored by Souptick Joarder's avatar Souptick Joarder Committed by Boris Ostrovsky
Browse files

swiotlb-xen: Convert to use macro



Rather than using static int max_dma_bits, this
can be coverted to use as macro.

Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 089cf7f6
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@
#include <asm/xen/page-coherent.h>
#include <asm/xen/page-coherent.h>


#include <trace/events/swiotlb.h>
#include <trace/events/swiotlb.h>
#define MAX_DMA_BITS 32
/*
/*
 * Used to do a quick range check in swiotlb_tbl_unmap_single and
 * Used to do a quick range check in swiotlb_tbl_unmap_single and
 * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this
 * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this
@@ -114,8 +115,6 @@ static int is_xen_swiotlb_buffer(dma_addr_t dma_addr)
	return 0;
	return 0;
}
}


static int max_dma_bits = 32;

static int
static int
xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
{
{
@@ -135,7 +134,7 @@ xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
				p + (i << IO_TLB_SHIFT),
				p + (i << IO_TLB_SHIFT),
				get_order(slabs << IO_TLB_SHIFT),
				get_order(slabs << IO_TLB_SHIFT),
				dma_bits, &dma_handle);
				dma_bits, &dma_handle);
		} while (rc && dma_bits++ < max_dma_bits);
		} while (rc && dma_bits++ < MAX_DMA_BITS);
		if (rc)
		if (rc)
			return rc;
			return rc;