From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: S5PV310: Optimize interrupt source searching code
Date: Tue, 28 Sep 2010 16:45:59 +0400 [thread overview]
Message-ID: <4CA1E387.709@ru.mvista.com> (raw)
In-Reply-To: <1285637510-16740-1-git-send-email-kgene.kim@samsung.com>
Hello.
On 28-09-2010 5:31, Kukjin Kim wrote:
> From: Changhwan Youn<chaos.youn@samsung.com>
> It is reported by Junseok Jung that using clz instruction is
> better instead of using for-loop to find the interrupt source.
> This patch modifies interrupt source searching code using __fls().
> The __fls() is implemented using clz instruction.
> Suggested-by: Junseok Jung<jundols.jung@samsung.com>
> Signed-off-by: Changhwan Youn<chaos.youn@samsung.com>
> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> ---
> arch/arm/mach-s5pv310/irq-combiner.c | 6 +-----
> 1 files changed, 1 insertions(+), 5 deletions(-)
> diff --git a/arch/arm/mach-s5pv310/irq-combiner.c b/arch/arm/mach-s5pv310/irq-combiner.c
> index 0f70521..39e3647 100644
> --- a/arch/arm/mach-s5pv310/irq-combiner.c
> +++ b/arch/arm/mach-s5pv310/irq-combiner.c
> @@ -66,11 +66,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
> if (status == 0)
> goto out;
>
> - for (combiner_irq = 0; combiner_irq< 32; combiner_irq++) {
> - if (status & 0x1)
> - break;
> - status>>= 1;
> - }
> + combiner_irq = __fls(status);
But the loop finds the *first* set bit, not the last...
WBR, Sergei
next prev parent reply other threads:[~2010-09-28 12:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 1:31 [PATCH] ARM: S5PV310: Optimize interrupt source searching code Kukjin Kim
2010-09-28 12:45 ` Sergei Shtylyov [this message]
2010-09-28 13:01 ` Michał Nazarewicz
2010-09-28 14:07 ` Kukjin Kim
2010-09-28 13:10 ` Kukjin Kim
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=4CA1E387.709@ru.mvista.com \
--to=sshtylyov@mvista.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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