aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Garry <[email protected]>2022-09-07 21:34:41 +0800
committerJoerg Roedel <[email protected]>2022-09-09 09:27:03 +0200
commit189cb8fec14acf4dee59eb2011519e86d389cd3e (patch)
tree42fd93c1b6d29310be0630665e9928e77e806bf3
parent8b2818c7be7bc49133c50f384247e9164a225e3f (diff)
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]>
-rw-r--r--drivers/iommu/iova.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
index 8aece052ce72..a44ad92fc5eb 100644
--- a/drivers/iommu/iova.c
+++ b/drivers/iommu/iova.c
@@ -875,7 +875,7 @@ static unsigned long iova_rcache_get(struct iova_domain *iovad,
{
unsigned int log_size = order_base_2(size);
- if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE || !iovad->rcaches)
+ if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE)
return 0;
return __iova_rcache_get(&iovad->rcaches[log_size], limit_pfn - size);