lkml.org 
[lkml]   [2011]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] irqdomain: protect macro variable in domain iterators
Date
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
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


\
 
 \ /
  Last update: 2011-12-02 14:33    [W:0.050 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site