MIPS: SGI-IP30: Use bitmap API when iterating over bitmap
PATCH 1/1 MIPS: SGI-IP30: Use bitmap API when iterating over bitmap
Do not open-code bitmap_set(). Besides, <linux/bitmap.h> API allows architecture specific optimizations, so prefer it.
Use the HEART_NUM_IRQS definition to express the end of the HEART bitmap.
--- arch/mips/sgi-ip30/ip30-irq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/mips/sgi-ip30/ip30-irq.c +1 -3
@@ -264,7 +264,6 @@ void __init arch_init_irq(void)struct irq_domain *domain;struct fwnode_handle *fn;unsigned long *mask; -int i;mips_cpu_irq_init ();
@@ -300,8 +299,7 @@ void __init arch_init_irq(void)set_bit (HEART_L3_INT_TIMER , heart_irq_map);/* Reserve the error interrupts (#51 to #63). */ -for (i =HEART_L4_INT_XWID_ERR_9 ; i <=HEART_L4_INT_HEART_EXCP ; i++) -set_bit (i, heart_irq_map); +bitmap_set (heart_irq_map,HEART_L4_INT_XWID_ERR_9 ,HEART_NUM_IRQS ); fn =irq_domain_alloc_named_fwnode ("HEART" );WARN_ON (fn ==NULL );
Signature · 1 line
2.41.0
Thomas Bogendoerfer
maintainerQuoted 5 lines · Philippe Mathieu-Daudé
Do not open-code
bitmap_set(). Besides, <linux/bitmap.h> API allows architecture specific optimizations, so prefer it.Use the
HEART_NUM_IRQSdefinition to express the end of the HEART bitmap.
please use HEART_L4_INT_HEART_EXCP + 1, like what the code did before.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Quoted 25 lines · Philippe Mathieu-Daudé
Do not open-code
bitmap_set(). Besides, <linux/bitmap.h> API allows architecture specific optimizations, so prefer it.Use the
HEART_NUM_IRQSdefinition to express the end of the HEART bitmap.Inspired-by Yury Norov <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- arch/mips/sgi-ip30/ip30-irq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/mips/sgi-ip30/ip30-irq.c +0
-1@@ -264,7 +264,6 @@ void __init arch_init_irq(void)struct irq_domain *domain;struct fwnode_handle *fn;unsigned long *mask; -int i;mips_cpu_irq_init ();
arch/mips/sgi-ip30/ip30-irq.c void __init arch_init_irq(void) · line 302
Quoted 6 lines
arch/mips/sgi-ip30/ip30-irq.c +1
-2@@ -300,8 +299,7 @@ void __init arch_init_irq(void)set_bit (HEART_L3_INT_TIMER , heart_irq_map);/* Reserve the error interrupts (#51 to #63). */ -for (i =HEART_L4_INT_XWID_ERR_9 ; i <=HEART_L4_INT_HEART_EXCP ; i++) -set_bit (i, heart_irq_map); +bitmap_set (heart_irq_map,HEART_L4_INT_XWID_ERR_9 ,HEART_NUM_IRQS );
This function has a signature
bitmap_set(map, start, length)
So this should be a:
bitmap_set(heart_irq_map, HEART_L4_INT_XWID_ERR_9,
HEART_NUM_IRQS - HEART_L4_INT_XWID_ERR_9 + 1)Also on the above group of set_bit(). It should be 2 bitmap_set() calls to me. HEART_L0_INT [0, 2] is the first one, and HEART_L2_INT to HEART_L4_INT [46, 63] is the other. Isn't?
Thanks,
Yury
Quoted 28 lines · Yury Norov
Quoted 27 lines · Philippe Mathieu-Daudé
Do not open-code
bitmap_set(). Besides, <linux/bitmap.h> API allows architecture specific optimizations, so prefer it.Use the
HEART_NUM_IRQSdefinition to express the end of the HEART bitmap.Inspired-by Yury Norov <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- arch/mips/sgi-ip30/ip30-irq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/mips/sgi-ip30/ip30-irq.c +0
-1@@ -264,7 +264,6 @@ void __init arch_init_irq(void)struct irq_domain *domain;struct fwnode_handle *fn;unsigned long *mask; -int i;mips_cpu_irq_init ();@@ -300,8 +299,7 @@ void __init arch_init_irq(void)set_bit (HEART_L3_INT_TIMER , heart_irq_map);
Quoted 7 lines
arch/mips/sgi-ip30/ip30-irq.c void __init arch_init_irq(void) · line 302
Quoted 4 lines
arch/mips/sgi-ip30/ip30-irq.c +1
-2/* Reserve the error interrupts (#51 to #63). */ -for (i =HEART_L4_INT_XWID_ERR_9 ; i <=HEART_L4_INT_HEART_EXCP ; i++) -set_bit (i, heart_irq_map); +bitmap_set (heart_irq_map,HEART_L4_INT_XWID_ERR_9 ,HEART_NUM_IRQS );This function has a signature
bitmap_set(map, start, length)
Doh, I thought it was (map, from_inc, to_exc), my bad.
Quoted 7 lines
So this should be a:
bitmap_set(heart_irq_map, HEART_L4_INT_XWID_ERR_9, HEART_NUM_IRQS - HEART_L4_INT_XWID_ERR_9 + 1)Also on the above group of
set_bit(). It should be 2bitmap_set()calls to me.HEART_L0_INT[0, 2] is the first one, andHEART_L2_INTtoHEART_L4_INT[46, 63] is the other. Isn't?
Please disregard this patch, sorry for the noise.
Regards,
Phil.