Skip to content

Commit 39e7d2a

Browse files
Petr TesarikChristoph Hellwig
authored andcommitted
swiotlb: use wrap_area_index() instead of open-coding it
No functional change, just use an existing helper. Signed-off-by: Petr Tesarik <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 7c3940b commit 39e7d2a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/dma/swiotlb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,7 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index,
695695
/*
696696
* Update the indices to avoid searching in the next round.
697697
*/
698-
if (index + nslots < mem->area_nslabs)
699-
area->index = index + nslots;
700-
else
701-
area->index = 0;
698+
area->index = wrap_area_index(mem, index + nslots);
702699
area->used += nslots;
703700
spin_unlock_irqrestore(&area->lock, flags);
704701
return slot_index;

0 commit comments

Comments
 (0)