summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorSouptick Joarder <jrdr.linux@gmail.com>2019-09-02 11:39:58 +0300
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2019-09-06 16:20:50 +0300
commite6fa0dc86734f99b037b36b8682133efc2b6e16b (patch)
treea85a36f99d9a1f53e0d8e109e0954bb809bb0322 /drivers/xen
parent089cf7f6ecb266b6a4164919a2e69bd2f938374a (diff)
downloadlinux-e6fa0dc86734f99b037b36b8682133efc2b6e16b.tar.xz
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: Souptick Joarder <jrdr.linux@gmail.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/swiotlb-xen.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index ae1df496bf38..d1eced53bdda 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -38,6 +38,7 @@
#include <asm/xen/page-coherent.h>
#include <trace/events/swiotlb.h>
+#define MAX_DMA_BITS 32
/*
* 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
@@ -114,8 +115,6 @@ static int is_xen_swiotlb_buffer(dma_addr_t dma_addr)
return 0;
}
-static int max_dma_bits = 32;
-
static int
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),
get_order(slabs << IO_TLB_SHIFT),
dma_bits, &dma_handle);
- } while (rc && dma_bits++ < max_dma_bits);
+ } while (rc && dma_bits++ < MAX_DMA_BITS);
if (rc)
return rc;