diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index 63a82b194ca..db5992dea7b 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -93,10 +93,6 @@ volatile uint32_t *g_current_regs[1]; extern uint32_t _vectors[]; -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -261,15 +257,9 @@ static int efm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, { if (irq < NR_VECTORS) { - n = irq - EFM32_IRQ_INTERRUPTS; + n = irq - EFM32_IRQ_INTERRUPTS; *regaddr = NVIC_IRQ_ENABLE(n) + offset; - - while (n >= 32) - { - n -= 32; - } - - *bit = 1 << n; + *bit = (uint32_t)1 << (n & 0x1f); } else { diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index 26881472c8d..09680bd9e91 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -91,10 +91,6 @@ volatile uint32_t *g_current_regs[1]; extern uint32_t _vectors[]; -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -250,15 +246,9 @@ static int lpc43_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, if (irq >= LPC43_IRQ_EXTINT) { - n = irq - LPC43_IRQ_EXTINT; + n = irq - LPC43_IRQ_EXTINT; *regaddr = NVIC_IRQ_ENABLE(n) + offset; - - while (n >= 32) - { - n -= 32; - } - - *bit = 1 << n; + *bit = (uint32_t)1 << (n & 0x1f); } /* Handle processor exceptions. Only a few can be disabled */ diff --git a/arch/arm/src/stm32/stm32_exti_alarm.c b/arch/arm/src/stm32/stm32_exti_alarm.c index f38574f2523..2e6d582a4aa 100644 --- a/arch/arm/src/stm32/stm32_exti_alarm.c +++ b/arch/arm/src/stm32/stm32_exti_alarm.c @@ -53,10 +53,6 @@ #include "stm32_gpio.h" #include "stm32_exti.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -65,10 +61,6 @@ static xcpt_t stm32_exti_callback; -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index ea7c4ddfcbe..ff40bf8d033 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -253,15 +253,9 @@ static int stm32_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, if (irq >= STM32_IRQ_FIRST) { - n = irq - STM32_IRQ_FIRST; + n = irq - STM32_IRQ_FIRST; *regaddr = NVIC_IRQ_ENABLE(n) + offset; - - while (n >= 32) - { - n -= 32; - } - - *bit = 1 << n; + *bit = (uint32_t)1 << (n & 0x1f); } /* Handle processor exceptions. Only a few can be disabled */ diff --git a/arch/arm/src/stm32l4/stm32l4_irq.c b/arch/arm/src/stm32l4/stm32l4_irq.c index 8e90bf0fa8a..7376b146753 100644 --- a/arch/arm/src/stm32l4/stm32l4_irq.c +++ b/arch/arm/src/stm32l4/stm32l4_irq.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32l4/stm32l4_irq.c - * arch/arm/src/chip/stm32l4_irq.c * - * Copyright (C) 2009-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -90,10 +89,6 @@ volatile uint32_t *g_current_regs[1]; extern uint32_t _vectors[]; -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -254,13 +249,7 @@ static int stm32l4_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit, { n = irq - STM32L4_IRQ_FIRST; *regaddr = NVIC_IRQ_ENABLE(n) + offset; - - while (n >= 32) - { - n -= 32; - } - - *bit = 1 << n; + *bit = (uint32_t)1 << (n & 0x1f); } /* Handle processor exceptions. Only a few can be disabled */