summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/io-pgtable-arm.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-04-26 12:49:29 +0800
committerJoerg Roedel <jroedel@suse.de>2018-05-03 15:31:07 +0200
commitf793b13ef0c9c11971334eb1c2544f81865b0d74 (patch)
tree70f35f8475cb2e2db17f50afd2dd1e22fa5ef292 /drivers/iommu/io-pgtable-arm.c
parent6da6c0db5316275015e8cc2959f12a17584aeb64 (diff)
downloadlinux-stable-f793b13ef0c9c11971334eb1c2544f81865b0d74.tar.gz
linux-stable-f793b13ef0c9c11971334eb1c2544f81865b0d74.tar.bz2
linux-stable-f793b13ef0c9c11971334eb1c2544f81865b0d74.zip
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.c')
-rw-r--r--drivers/iommu/io-pgtable-arm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 39c2a056da21..4ffdd88b1566 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -1120,8 +1120,7 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
/* Full unmap */
iova = 0;
- j = find_first_bit(&cfg->pgsize_bitmap, BITS_PER_LONG);
- while (j != BITS_PER_LONG) {
+ for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
size = 1UL << j;
if (ops->unmap(ops, iova, size) != size)
@@ -1138,8 +1137,6 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
return __FAIL(ops, i);
iova += SZ_1G;
- j++;
- j = find_next_bit(&cfg->pgsize_bitmap, BITS_PER_LONG, j);
}
free_io_pgtable_ops(ops);