summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/io-pgtable-arm-v7s.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2016-09-21 07:41:31 +0200
committerWill Deacon <will.deacon@arm.com>2016-11-29 16:57:40 +0100
commit4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838 (patch)
tree4f1c3df2a5567793ba65ace0725f2284e4911bfe /drivers/iommu/io-pgtable-arm-v7s.c
parentLinux 4.9-rc5 (diff)
downloadlinux-4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838.tar.xz
linux-4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838.zip
iommu/io-pgtable-arm: Use for_each_set_bit to simplify the code
We can use for_each_set_bit() to simplify the code slightly in the ARM io-pgtable self tests. Reviewed-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/io-pgtable-arm-v7s.c')
-rw-r--r--drivers/iommu/io-pgtable-arm-v7s.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c
index f50e51c1a9c8..0769276c0537 100644
--- a/drivers/iommu/io-pgtable-arm-v7s.c
+++ b/drivers/iommu/io-pgtable-arm-v7s.c
@@ -793,8 +793,7 @@ static int __init arm_v7s_do_selftests(void)
* Distinct mappings of different granule sizes.
*/
iova = 0;
- i = find_first_bit(&cfg.pgsize_bitmap, BITS_PER_LONG);
- while (i != BITS_PER_LONG) {
+ for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
size = 1UL << i;
if (ops->map(ops, iova, iova, size, IOMMU_READ |
IOMMU_WRITE |
@@ -811,8 +810,6 @@ static int __init arm_v7s_do_selftests(void)
return __FAIL(ops);
iova += SZ_16M;
- i++;
- i = find_next_bit(&cfg.pgsize_bitmap, BITS_PER_LONG, i);
loopnr++;
}