Skip to content

Commit a6a2417

Browse files
rosslagerwallChristoph Hellwig
authored andcommitted
swiotlb: use the calculated number of areas
Commit 8ac0406 ("swiotlb: reduce the number of areas to match actual memory pool size") calculated the reduced number of areas in swiotlb_init_remap() but didn't actually use the value. Replace usage of default_nareas accordingly. Fixes: 8ac0406 ("swiotlb: reduce the number of areas to match actual memory pool size") Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 0bb80ec commit a6a2417

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/dma/swiotlb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,13 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
399399
}
400400

401401
mem->areas = memblock_alloc(array_size(sizeof(struct io_tlb_area),
402-
default_nareas), SMP_CACHE_BYTES);
402+
nareas), SMP_CACHE_BYTES);
403403
if (!mem->areas) {
404404
pr_warn("%s: Failed to allocate mem->areas.\n", __func__);
405405
return;
406406
}
407407

408-
swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false,
409-
default_nareas);
408+
swiotlb_init_io_tlb_pool(mem, __pa(tlb), nslabs, false, nareas);
410409
add_mem_pool(&io_tlb_default_mem, mem);
411410

412411
if (flags & SWIOTLB_VERBOSE)

0 commit comments

Comments
 (0)