diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2016-09-21 13:41:31 +0800 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-11-29 15:57:40 +0000 |
commit | 4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838 (patch) | |
tree | 4f1c3df2a5567793ba65ace0725f2284e4911bfe /drivers/iommu/io-pgtable-arm-v7s.c | |
parent | a25f0944ba9b1d8a6813fd6f1a86f1bd59ac25a6 (diff) | |
download | op-kernel-dev-4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838.zip op-kernel-dev-4ae8a5c528c0b1ed20f0a06bed15e2fddf3f3838.tar.gz |
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.c | 5 |
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 f50e51c..0769276 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++; } |