From: Petr Tesarik Date: Tue, 21 Mar 2023 08:31:26 +0000 (+0100) Subject: swiotlb: use wrap_area_index() instead of open-coding it X-Git-Tag: v6.6.7~2949^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39e7d2ab6ea9fd6b389091ec223d566934fe7be5;p=platform%2Fkernel%2Flinux-starfive.git swiotlb: use wrap_area_index() instead of open-coding it No functional change, just use an existing helper. Signed-off-by: Petr Tesarik Signed-off-by: Christoph Hellwig --- diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 91454b5..3856e2b 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;