Skip to content

Commit e6fa0dc

Browse files
Souptick Joarderbostrovs
authored andcommitted
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 <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 089cf7f commit e6fa0dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/xen/swiotlb-xen.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <asm/xen/page-coherent.h>
3939

4040
#include <trace/events/swiotlb.h>
41+
#define MAX_DMA_BITS 32
4142
/*
4243
* Used to do a quick range check in swiotlb_tbl_unmap_single and
4344
* 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)
114115
return 0;
115116
}
116117

117-
static int max_dma_bits = 32;
118-
119118
static int
120119
xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
121120
{
@@ -135,7 +134,7 @@ xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
135134
p + (i << IO_TLB_SHIFT),
136135
get_order(slabs << IO_TLB_SHIFT),
137136
dma_bits, &dma_handle);
138-
} while (rc && dma_bits++ < max_dma_bits);
137+
} while (rc && dma_bits++ < MAX_DMA_BITS);
139138
if (rc)
140139
return rc;
141140

0 commit comments

Comments
 (0)