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>
This commit is contained in:
Petr Tesarik
2023-03-21 09:31:26 +01:00
committed by Christoph Hellwig
parent 7c3940bf81
commit 39e7d2ab6e

View File

@@ -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;