summaryrefslogtreecommitdiff
path: root/drivers/iommu/io-pgtable-arm.c
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2015-06-01 16:12:26 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:12:54 -0700
commite7f0469ba0a397b4b0f3150b406e279101a60f0e (patch)
tree02e42476a2e40b505e53188c95242e4d97c546f5 /drivers/iommu/io-pgtable-arm.c
parent3671f9ec4a549d89248b63eaa78d6391c897dcce (diff)
iommu: io-pgtable-arm: Improve coverage of arm_lpae_range_has_mapping
The arm_lpae_range_has_mapping currently checks if there are any non-mapped slots in a given iova range, but it's really meant to check if there is *any* mapping whatsoever in a given iova range. Fix this. Change-Id: I90e426ab157cc194328b754ac5021051ac883603 Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Diffstat (limited to 'drivers/iommu/io-pgtable-arm.c')
-rw-r--r--drivers/iommu/io-pgtable-arm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index de0a88059aa6..506b75fdc989 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -954,7 +954,7 @@ static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops)
})
/*
- * Returns true if the entire iova range has any mapping in ops.
+ * Returns true if there's any mapping in the given iova range in ops.
*/
static bool arm_lpae_range_has_mapping(struct io_pgtable_ops *ops,
unsigned long iova_start, size_t size)
@@ -962,11 +962,11 @@ static bool arm_lpae_range_has_mapping(struct io_pgtable_ops *ops,
unsigned long iova = iova_start;
while (iova < (iova_start + size)) {
- if (!ops->iova_to_phys(ops, iova + 42))
- return false;
+ if (ops->iova_to_phys(ops, iova + 42))
+ return true;
iova += SZ_4K;
}
- return true;
+ return false;
}
/*