summaryrefslogtreecommitdiffstats
path: root/kernel/dma
diff options
context:
space:
mode:
authorPetr Tesarik <petr.tesarik.ext@huawei.com>2023-03-21 09:31:26 +0100
committerChristoph Hellwig <hch@lst.de>2023-03-22 09:02:35 +0100
commit39e7d2ab6ea9fd6b389091ec223d566934fe7be5 (patch)
tree55940df7cd49848b4bfdc966183ff54cb8c52156 /kernel/dma
parentswiotlb: fix the deadlock in swiotlb_do_find_slots (diff)
downloadlinux-39e7d2ab6ea9fd6b389091ec223d566934fe7be5.tar.xz
linux-39e7d2ab6ea9fd6b389091ec223d566934fe7be5.zip
swiotlb: use wrap_area_index() instead of open-coding it
No functional change, just use an existing helper. Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma')
-rw-r--r--kernel/dma/swiotlb.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 91454b513db0..3856e2b524b4 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -695,10 +695,7 @@ found:
/*
* Update the indices to avoid searching in the next round.
*/
- if (index + nslots < mem->area_nslabs)
- area->index = index + nslots;
- else
- area->index = 0;
+ area->index = wrap_area_index(mem, index + nslots);
area->used += nslots;
spin_unlock_irqrestore(&area->lock, flags);
return slot_index;