From: Jiri Slaby <jirislaby@kernel.org>
To: Yury Norov <yury.norov@gmail.com>,
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
Subject: Re: [PATCH 3/3] KVM: PPC: use for_each_set_bit() in IRQ_check()
Date: Tue, 22 Jul 2025 10:23:59 +0200 [thread overview]
Message-ID: <4c7cbd2e-7f94-4f02-b18a-7b2694e93412@kernel.org> (raw)
In-Reply-To: <20250717192418.207114-4-yury.norov@gmail.com>
On 17. 07. 25, 21:24, Yury Norov wrote:
> 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;
Can be unsigned now, right?
> 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);
>
thanks,
--
js
suse labs
prev parent reply other threads:[~2025-07-22 8: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 ` [PATCH 3/3] KVM: PPC: use for_each_set_bit() in IRQ_check() Yury Norov
2025-07-22 8:23 ` Jiri Slaby [this message]
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=4c7cbd2e-7f94-4f02-b18a-7b2694e93412@kernel.org \
--to=jirislaby@kernel.org \
--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 \
--cc=yury.norov@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).