提交 39e7d2ab 编写于 作者: P Petr Tesarik 提交者: Christoph Hellwig

swiotlb: use wrap_area_index() instead of open-coding it

No functional change, just use an existing helper.
Signed-off-by: NPetr Tesarik <petr.tesarik.ext@huawei.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 7c3940bf
...@@ -695,10 +695,7 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index, ...@@ -695,10 +695,7 @@ static int swiotlb_do_find_slots(struct device *dev, int area_index,
/* /*
* Update the indices to avoid searching in the next round. * Update the indices to avoid searching in the next round.
*/ */
if (index + nslots < mem->area_nslabs) area->index = wrap_area_index(mem, index + nslots);
area->index = index + nslots;
else
area->index = 0;
area->used += nslots; area->used += nslots;
spin_unlock_irqrestore(&area->lock, flags); spin_unlock_irqrestore(&area->lock, flags);
return slot_index; return slot_index;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册