[1/2] um: irq: Fix LAST_IRQ usage
diff mbox series

Message ID 20190731202942.29630-1-johannes@sipsolutions.net
State New
Headers show
Series
  • [1/2] um: irq: Fix LAST_IRQ usage
Related show

Commit Message

Johannes Berg July 31, 2019, 8:29 p.m. UTC
From: Erel Geron <erelx.geron@intel.com>

LAST_IRQ was used incorrectly in init_IRQ.
Fix this.

Signed-off-by: Erel Geron <erelx.geron@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Anton submitted a very similar patch, but didn't update init_IRQ(),
which seems necessary.
---
 arch/um/include/asm/irq.h | 2 +-
 arch/um/kernel/irq.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Anton Ivanov July 31, 2019, 8:46 p.m. UTC | #1
On 31/07/2019 21:29, Johannes Berg wrote:
> From: Erel Geron <erelx.geron@intel.com>
> 
> LAST_IRQ was used incorrectly in init_IRQ.
> Fix this.
> 
> Signed-off-by: Erel Geron <erelx.geron@intel.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> Anton submitted a very similar patch, but didn't update init_IRQ(),
> which seems necessary.
> ---
>   arch/um/include/asm/irq.h | 2 +-
>   arch/um/kernel/irq.c      | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/um/include/asm/irq.h b/arch/um/include/asm/irq.h
> index 49ed3e35b35a..ce7a78c3bcf2 100644
> --- a/arch/um/include/asm/irq.h
> +++ b/arch/um/include/asm/irq.h
> @@ -23,7 +23,7 @@
>   #define VECTOR_BASE_IRQ		15
>   #define VECTOR_IRQ_SPACE	8
>   
> -#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ)
> +#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ - 1)
>   
>   #else
>   
> diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
> index efde1f16c603..402e59bdb65b 100644
> --- a/arch/um/kernel/irq.c
> +++ b/arch/um/kernel/irq.c
> @@ -480,7 +480,7 @@ void __init init_IRQ(void)
>   	irq_set_chip_and_handler(TIMER_IRQ, &SIGVTALRM_irq_type, handle_edge_irq);
>   
>   
> -	for (i = 1; i < LAST_IRQ; i++)
> +	for (i = 1; i <= LAST_IRQ; i++)
>   		irq_set_chip_and_handler(i, &normal_irq_type, handle_edge_irq);
>   	/* Initialize EPOLL Loop */
>   	os_setup_epoll();
> 

Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk>

Patch
diff mbox series

diff --git a/arch/um/include/asm/irq.h b/arch/um/include/asm/irq.h
index 49ed3e35b35a..ce7a78c3bcf2 100644
--- a/arch/um/include/asm/irq.h
+++ b/arch/um/include/asm/irq.h
@@ -23,7 +23,7 @@ 
 #define VECTOR_BASE_IRQ		15
 #define VECTOR_IRQ_SPACE	8
 
-#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ)
+#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ - 1)
 
 #else
 
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index efde1f16c603..402e59bdb65b 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -480,7 +480,7 @@  void __init init_IRQ(void)
 	irq_set_chip_and_handler(TIMER_IRQ, &SIGVTALRM_irq_type, handle_edge_irq);
 
 
-	for (i = 1; i < LAST_IRQ; i++)
+	for (i = 1; i <= LAST_IRQ; i++)
 		irq_set_chip_and_handler(i, &normal_irq_type, handle_edge_irq);
 	/* Initialize EPOLL Loop */
 	os_setup_epoll();