From: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH v2] irqdomain: protect macro variable in domain iterators
Date: Fri, 2 Dec 2011 14:30:09 +0100 [thread overview]
Message-ID: <1322832609-24956-1-git-send-email-nicolas.ferre@atmel.com> (raw)
In-Reply-To: <1322833997-32083-1-git-send-email-nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
---
v2: add brackets to each macro variable.
include/linux/irqdomain.h | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index bd4272b..e535063 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -82,12 +82,14 @@ static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
}
#define irq_domain_for_each_hwirq(d, hw) \
- for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++)
+ for ((hw) = (d)->hwirq_base; \
+ (hw) < (d)->hwirq_base + (d)->nr_irq; \
+ (hw)++)
#define irq_domain_for_each_irq(d, hw, irq) \
- for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \
- hw < d->hwirq_base + d->nr_irq; \
- hw++, irq = irq_domain_to_irq(d, hw))
+ for ((hw) = (d)->hwirq_base, (irq) = irq_domain_to_irq((d), (hw)); \
+ (hw) < (d)->hwirq_base + (d)->nr_irq; \
+ (hw)++, (irq) = irq_domain_to_irq((d), (hw)))
extern void irq_domain_add(struct irq_domain *domain);
extern void irq_domain_del(struct irq_domain *domain);
--
1.7.5.4
next prev parent reply other threads:[~2011-12-02 13:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 13:53 [PATCH] irqdomain: protect macro variable in domain iterators Nicolas Ferre
[not found] ` <1322833997-32083-1-git-send-email-nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2011-12-02 12:59 ` Dave Martin
[not found] ` <20111202125932.GB2892-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-12-02 13:25 ` Nicolas Ferre
2011-12-02 13:51 ` Rob Herring
[not found] ` <4ED8D7FE.1000205-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-12-02 14:30 ` Dave Martin
2011-12-02 13:30 ` Nicolas Ferre [this message]
[not found] ` <1322832609-24956-1-git-send-email-nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2011-12-02 13:44 ` [PATCH v2] " Dave Martin
[not found] ` <20111202134458.GD2892-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2011-12-08 9:37 ` Nicolas Ferre
2011-12-08 13:30 ` Rob Herring
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=1322832609-24956-1-git-send-email-nicolas.ferre@atmel.com \
--to=nicolas.ferre-aife0yeh4naavxtiumwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).