Skip to content

Commit 189cb8f

Browse files
John Garryjoergroedel
authored andcommitted
iova: Remove iovad->rcaches check in iova_rcache_get()
The iovad->rcaches check in iova_rcache_get() is pretty much useless without the same check in iova_rcache_insert(). Instead of adding this symmetric check to fastpath iova_rcache_insert(), drop the check in iova_rcache_get() in favour of making the IOVA domain rcache init more robust to failure in future. Signed-off-by: John Garry <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8b2818c commit 189cb8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/iova.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ static unsigned long iova_rcache_get(struct iova_domain *iovad,
875875
{
876876
unsigned int log_size = order_base_2(size);
877877

878-
if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE || !iovad->rcaches)
878+
if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE)
879879
return 0;
880880

881881
return __iova_rcache_get(&iovad->rcaches[log_size], limit_pfn - size);

0 commit comments

Comments
 (0)