diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-04-26 12:49:29 +0800 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2018-05-03 15:31:07 +0200 |
commit | f793b13ef0c9c11971334eb1c2544f81865b0d74 (patch) | |
tree | 70f35f8475cb2e2db17f50afd2dd1e22fa5ef292 /drivers/iommu/io-pgtable-arm-v7s.c | |
parent | 6da6c0db5316275015e8cc2959f12a17584aeb64 (diff) |
iommu/io-pgtable-arm: Use for_each_set_bit to simplify code
We can use for_each_set_bit() to simplify code slightly in the
ARM io-pgtable self tests while unmapping.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
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 10e4a3d11c02..50e3a9fcf43e 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -898,8 +898,7 @@ static int __init arm_v7s_do_selftests(void) /* Full unmap */ 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->unmap(ops, iova, size) != size) @@ -916,8 +915,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); } free_io_pgtable_ops(ops); |