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 <cgoldswo@codeaurora.org>
This commit is contained in:
Chris Goldsworthy 2020-01-15 02:00:55 -08:00
commit 240d6f5367

View file

@ -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) {