From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Ferre Subject: [PATCH v2] irqdomain: protect macro variable in domain iterators Date: Fri, 2 Dec 2011 14:30:09 +0100 Message-ID: <1322832609-24956-1-git-send-email-nicolas.ferre@atmel.com> References: <1322833997-32083-1-git-send-email-nicolas.ferre@atmel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1322833997-32083-1-git-send-email-nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@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 List-Id: devicetree@vger.kernel.org Signed-off-by: Nicolas Ferre --- 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