kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>
Subject: [PATCH 3/3] KVM: PPC: use for_each_set_bit() in IRQ_check()
Date: Thu, 17 Jul 2025 15:24:16 -0400	[thread overview]
Message-ID: <20250717192418.207114-4-yury.norov@gmail.com> (raw)
In-Reply-To: <20250717192418.207114-1-yury.norov@gmail.com>

From: Yury Norov (NVIDIA) <yury.norov@gmail.com>

The function opencodes for_each_set_bit() macro.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
---
 arch/powerpc/kvm/mpic.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 23e9c2bd9f27..ae68b213f0f9 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -290,15 +290,11 @@ static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ)
 
 static void IRQ_check(struct openpic *opp, struct irq_queue *q)
 {
-	int irq = -1;
+	int irq;
 	int next = -1;
 	int priority = -1;
 
-	for (;;) {
-		irq = find_next_bit(q->queue, opp->max_irq, irq + 1);
-		if (irq == opp->max_irq)
-			break;
-
+	for_each_set_bit(irq, q->queue, opp->max_irq) {
 		pr_debug("IRQ_check: irq %d set ivpr_pr=%d pr=%d\n",
 			irq, IVPR_PRIORITY(opp->src[irq].ivpr), priority);
 
-- 
2.43.0


  parent reply	other threads:[~2025-07-17 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 19:24 [PATCH 0/3] KVM: PPC: use for_each_set_bit() macro where appropriate Yury Norov
2025-07-17 19:24 ` [PATCH 1/3] KVM: PPC: simplify kvmppc_core_prepare_to_enter() Yury Norov
2025-07-17 19:24 ` [PATCH 2/3] KVM: PPC: simplify kvmppc_core_check_exceptions() Yury Norov
2025-07-17 19:24 ` Yury Norov [this message]
2025-07-22  8:23   ` [PATCH 3/3] KVM: PPC: use for_each_set_bit() in IRQ_check() Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250717192418.207114-4-yury.norov@gmail.com \
    --to=yury.norov@gmail.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).