All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: kgene.kim@samsung.com, linus.walleij@stericsson.com,
	devicetree-discuss@lists.ozlabs.org, rmallon@gmail.com,
	rob.herring@calxeda.com, hsweeten@visionengravers.com,
	rajeev-dlh.kumar@st.com, ben-linux@fluff.org,
	STEricsson_nomadik_linux@list.st.com,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org, rubini@unipv.it
Subject: Re: [PATCHv2 02/10] ARM: vic: MULTI_IRQ_HANDLER handler
Date: Thu, 3 Nov 2011 09:49:55 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.02.1111030935060.3307@xanadu.home> (raw)
In-Reply-To: <20111103125136.GL12913@n2100.arm.linux.org.uk>

On Thu, 3 Nov 2011, Russell King - ARM Linux wrote:

> 	stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> 	while (stat) {
> 		while (stat) {
> 			irq = ffs(stat) - 1;
> 			stat &= ~(1 << irq);
> 			handle_irq(irq);
> 		}
> 		stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> 	}

The inner loop could be a do { } while() construct to avoid evaluating 
stat twice on each outer loop itteration.  Maybe gcc is smart enough to 
notice though, maybe not.


Nicolas

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 02/10] ARM: vic: MULTI_IRQ_HANDLER handler
Date: Thu, 3 Nov 2011 09:49:55 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.02.1111030935060.3307@xanadu.home> (raw)
In-Reply-To: <20111103125136.GL12913@n2100.arm.linux.org.uk>

On Thu, 3 Nov 2011, Russell King - ARM Linux wrote:

> 	stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> 	while (stat) {
> 		while (stat) {
> 			irq = ffs(stat) - 1;
> 			stat &= ~(1 << irq);
> 			handle_irq(irq);
> 		}
> 		stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
> 	}

The inner loop could be a do { } while() construct to avoid evaluating 
stat twice on each outer loop itteration.  Maybe gcc is smart enough to 
notice though, maybe not.


Nicolas

  parent reply	other threads:[~2011-11-03 13:49 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 10:41 [PATCHv2 00/10] VIC DT binding and MULTI_IRQ_HANDLER Jamie Iles
2011-09-28 10:41 ` Jamie Iles
2011-09-28 10:41 ` [PATCHv2 01/10] ARM: vic: device tree binding Jamie Iles
2011-09-28 10:41   ` Jamie Iles
     [not found]   ` <1317206507-18867-2-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
2011-09-28 20:11     ` Grant Likely
2011-09-28 20:11       ` Grant Likely
2011-09-29  4:00   ` Rob Herring
2011-09-29  4:00     ` Rob Herring
     [not found] ` <1317206507-18867-1-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
2011-09-28 10:41   ` [PATCHv2 02/10] ARM: vic: MULTI_IRQ_HANDLER handler Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 11:09     ` Linus Walleij
2011-09-28 11:09       ` Linus Walleij
2011-09-28 12:08       ` Jamie Iles
2011-09-28 12:08         ` Jamie Iles
2011-09-28 20:39     ` Grant Likely
2011-09-28 20:39       ` Grant Likely
2011-09-29  6:55       ` Linus Walleij
2011-09-29  6:55         ` Linus Walleij
     [not found]         ` <CACRpkdZKns-GraGp-YMD6jzOPETkvEpt9bC8HcYUmf3JUyCV3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-29  9:30           ` Jamie Iles
2011-09-29  9:30             ` Jamie Iles
     [not found]             ` <20110929093009.GM17204-apL1N+EY0C9YtYNIL7UdTEEOCMrvLtNR@public.gmane.org>
2011-09-29 16:55               ` Grant Likely
2011-09-29 16:55                 ` Grant Likely
2011-11-02 13:40               ` Russell King - ARM Linux
2011-11-02 13:40                 ` Russell King - ARM Linux
2011-11-02 14:08                 ` Jamie Iles
2011-11-02 14:08                   ` Jamie Iles
2011-11-03 12:29                   ` Linus Walleij
2011-11-03 12:29                     ` Linus Walleij
     [not found]                     ` <CACRpkdY+EBkHfupO5T4SYKPxzX2L2kr8fLVMJK=JctNeYAzn2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-03 12:51                       ` Russell King - ARM Linux
2011-11-03 12:51                         ` Russell King - ARM Linux
2011-11-03 13:00                         ` Linus Walleij
2011-11-03 13:00                           ` Linus Walleij
2011-11-03 13:04                           ` Jamie Iles
2011-11-03 13:04                             ` Jamie Iles
     [not found]                           ` <CACRpkdZ1qfVduMAmusNoLjDoqy2kDA4crN__iW9qEeXBgVT4cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-03 13:31                             ` Russell King - ARM Linux
2011-11-03 13:31                               ` Russell King - ARM Linux
2011-11-03 15:03                               ` Jamie Iles
2011-11-03 15:03                                 ` Jamie Iles
2011-11-03 15:11                                 ` Russell King - ARM Linux
2011-11-03 15:11                                   ` Russell King - ARM Linux
2011-11-03 13:49                         ` Nicolas Pitre [this message]
2011-11-03 13:49                           ` Nicolas Pitre
2011-09-29 15:03     ` Zoltan Devai
2011-09-29 15:03       ` Zoltan Devai
2011-09-29 15:13       ` Jamie Iles
2011-09-29 15:13         ` Jamie Iles
2011-09-28 10:41   ` [PATCHv2 03/10] ARM: ep93xx: convert to MULTI_IRQ_HANDLER Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 11:15     ` Linus Walleij
2011-09-28 11:15       ` Linus Walleij
2011-09-28 10:41   ` [PATCHv2 05/10] ARM: nomadik: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 11:12     ` Linus Walleij
2011-09-28 11:12       ` Linus Walleij
2011-09-28 10:41   ` [PATCHv2 06/10] ARM: s3c64xx: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 10:41   ` [PATCHv2 07/10] ARM: spear: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 10:41   ` [PATCHv2 08/10] ARM: u300: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 11:03     ` Linus Walleij
2011-09-28 11:03       ` Linus Walleij
2011-09-28 12:03       ` Jamie Iles
2011-09-28 12:03         ` Jamie Iles
     [not found]         ` <20110928120340.GH17204-apL1N+EY0C9YtYNIL7UdTEEOCMrvLtNR@public.gmane.org>
2011-09-28 12:18           ` Linus Walleij
2011-09-28 12:18             ` Linus Walleij
2011-09-28 12:29             ` Jamie Iles
2011-09-28 12:29               ` Jamie Iles
2011-09-28 10:41   ` [PATCHv2 09/10] ARM: versatile: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 10:41   ` [PATCHv2 10/10] ARM: samsung: " Jamie Iles
2011-09-28 10:41     ` Jamie Iles
2011-09-28 10:41 ` [PATCHv2 04/10] ARM: netx: " Jamie Iles
2011-09-28 10:41   ` Jamie Iles

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=alpine.LFD.2.02.1111030935060.3307@xanadu.home \
    --to=nicolas.pitre@linaro.org \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=ben-linux@fluff.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=hsweeten@visionengravers.com \
    --cc=kgene.kim@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rajeev-dlh.kumar@st.com \
    --cc=rmallon@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rubini@unipv.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.