From 240d6f5367dd3a7e931408a4bc1eb562c52d85d3 Mon Sep 17 00:00:00 2001 From: Chris Goldsworthy Date: Wed, 15 Jan 2020 02:00:55 -0800 Subject: [PATCH] iommu/arm-smmu: Replace while loop with for_each_set_bit Switch out a while loop that loops over the set bits in a bitmap with for_each_set_bit. Change-Id: I8843a0b36906979a09122a8ccb07c8081278bf3b Signed-off-by: Chris Goldsworthy --- drivers/iommu/arm-smmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index d8bfafa99243..5424d7a277e0 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -5053,7 +5053,7 @@ static void __arm_smmu_tlb_sync_timeout(struct arm_smmu_device *smmu) tcu_sync_pending = FIELD_GET(TCU_SYNC_IN_PRGSS, sync_inv_progress); if (__ratelimit(&_rs)) { - unsigned long tbu_id, tbus_t = tbu_ids; + unsigned long tbu_id; dev_err(smmu->dev, "TBU ACK 0x%x TBU PWR 0x%x TCU sync_inv 0x%x\n", @@ -5063,11 +5063,11 @@ static void __arm_smmu_tlb_sync_timeout(struct arm_smmu_device *smmu) tcu_inv_pending?"pending":"completed", tcu_sync_pending?"pending":"completed"); - while (tbus_t) { + for_each_set_bit(tbu_id, (unsigned long *) &tbu_ids, + sizeof(tbu_ids) * BITS_PER_BYTE) { + struct qsmmuv500_tbu_device *tbu; - tbu_id = __ffs(tbus_t); - tbus_t = tbus_t & ~(1 << tbu_id); tbu = qsmmuv500_find_tbu(smmu, (u16)(tbu_id << TBUID_SHIFT)); if (tbu) {