diff options
author | Yury Norov (NVIDIA) <yury.norov@gmail.com> | 2025-09-23 23:37:26 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@kernel.org> | 2025-09-23 23:37:26 +0800 |
commit | 77336b918f59b9c715d1f752149557a05e0bc0bc (patch) | |
tree | 90dffa8de1d5035ea5fa1950419d76229da0ea58 | |
parent | f851fdd895dea69e23acc80262da0b8f9e4d04ad (diff) |
LoongArch: KVM: Rework pch_pic_update_batch_irqs()
Use proper bitmap API and drop all the housekeeping code.
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r-- | arch/loongarch/kvm/intc/pch_pic.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/loongarch/kvm/intc/pch_pic.c b/arch/loongarch/kvm/intc/pch_pic.c index f464f1f5a67a..a698a73de399 100644 --- a/arch/loongarch/kvm/intc/pch_pic.c +++ b/arch/loongarch/kvm/intc/pch_pic.c @@ -35,16 +35,11 @@ static void pch_pic_update_irq(struct loongarch_pch_pic *s, int irq, int level) /* update batch irqs, the irq_mask is a bitmap of irqs */ static void pch_pic_update_batch_irqs(struct loongarch_pch_pic *s, u64 irq_mask, int level) { - int irq, bits; + unsigned int irq; + DECLARE_BITMAP(irqs, 64) = { BITMAP_FROM_U64(irq_mask) }; - /* find each irq by irqs bitmap and update each irq */ - bits = sizeof(irq_mask) * 8; - irq = find_first_bit((void *)&irq_mask, bits); - while (irq < bits) { + for_each_set_bit(irq, irqs, 64) pch_pic_update_irq(s, irq, level); - bitmap_clear((void *)&irq_mask, irq, 1); - irq = find_first_bit((void *)&irq_mask, bits); - } } /* called when a irq is triggered in pch pic */ |