ARM: gic: refactor irq_start assignment
PATCH 1/1 ARM: gic: refactor irq_start assignment
The irq_start and hwirq_base assignment code is fairly hairy and ended up being difficult to read following a conflict resolution for 3.2.
This patch rearranges the code slightly to make it easier to read.
--- arch/arm/common/gic.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
arch/arm/common/gic.c +6 -7
@@ -694,13 +694,12 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,* For primary GICs, skip over SGIs. * For secondary GICs, skip over PPIs, too. */ - domain->hwirq_base =32 ; -if (gic_nr ==0 ) { -if ((irq_start &31 ) >0 ) { - domain->hwirq_base =16 ; -if (irq_start !=-1 ) - irq_start = (irq_start & ~31 ) +16 ; - } +if (gic_nr ==0 && (irq_start &31 ) >0 ) { + domain->hwirq_base =16 ; +if (irq_start !=-1 ) + irq_start = (irq_start & ~31 ) +16 ; + }else { + domain->hwirq_base =32 ; }/*
Signature · 1 line
1.7.4.1
PATCH 1/1 ARM: gic: refactor irq_start assignment
Quoted 23 lines · Will Deacon
The
irq_startandhwirq_baseassignment code is fairly hairy and ended up being difficult to read following a conflict resolution for 3.2.This patch rearranges the code slightly to make it easier to read.
Cc Marc Zyngier <[email protected]>Signed-off-by Will Deacon <[email protected]>--- arch/arm/common/gic.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)arch/arm/common/gic.c +0
-4@@ -694,13 +694,12 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,* For primary GICs, skip over SGIs. * For secondary GICs, skip over PPIs, too. */ - domain->hwirq_base =32 ; -if (gic_nr ==0 ) { -if ((irq_start &31 ) >0 ) { - domain->hwirq_base =16 ;
arch/arm/common/gic.c void __init gic_init_bases(unsigned int gic_nr, int irq_start, · line 703
Quoted 10 lines
arch/arm/common/gic.c +6
-3-if (irq_start !=-1 ) - irq_start = (irq_start & ~31 ) +16 ; - } +if (gic_nr ==0 && (irq_start &31 ) >0 ) { + domain->hwirq_base =16 ; +if (irq_start !=-1 ) + irq_start = (irq_start & ~31 ) +16 ; + }else { + domain->hwirq_base =32 ; }
This should probably just be rolled into Grant's irqdomain work. In any case, it's going to conflict with it.
Rob
PATCH 1/1 ARM: gic: refactor irq_start assignment
Quoted 29 lines · Rob Herring
Quoted 28 lines · Will Deacon
The
irq_startandhwirq_baseassignment code is fairly hairy and ended up being difficult to read following a conflict resolution for 3.2.This patch rearranges the code slightly to make it easier to read.
Cc Marc Zyngier <[email protected]>Signed-off-by Will Deacon <[email protected]>--- arch/arm/common/gic.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)arch/arm/common/gic.c +2
-7@@ -694,13 +694,12 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,* For primary GICs, skip over SGIs. * For secondary GICs, skip over PPIs, too. */ - domain->hwirq_base =32 ; -if (gic_nr ==0 ) { -if ((irq_start &31 ) >0 ) { - domain->hwirq_base =16 ; -if (irq_start !=-1 ) - irq_start = (irq_start & ~31 ) +16 ; - } +if (gic_nr ==0 && (irq_start &31 ) >0 ) { + domain->hwirq_base =16 ;
Quoted 8 lines
arch/arm/common/gic.c void __init gic_init_bases(unsigned int gic_nr, int irq_start, · line 703
Quoted 5 lines
arch/arm/common/gic.c +4
-0+if (irq_start !=-1 ) + irq_start = (irq_start & ~31 ) +16 ; + }else { + domain->hwirq_base =32 ; }This should probably just be rolled into Grant's irqdomain work. In any case, it's going to conflict with it.
Ok, it's purely cosmetic so I'm fine with that. Grant - would you be able to pick this up please?
Thanks,
Will
PATCH 1/1 ARM: gic: refactor irq_start assignment
Quoted 39 lines · Will Deacon
Quoted 29 lines · Rob Herring
Quoted 28 lines · Will Deacon
The
irq_startandhwirq_baseassignment code is fairly hairy and ended up being difficult to read following a conflict resolution for 3.2.This patch rearranges the code slightly to make it easier to read.
Cc Marc Zyngier <[email protected]>Signed-off-by Will Deacon <[email protected]>--- arch/arm/common/gic.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)arch/arm/common/gic.c +2
-7@@ -694,13 +694,12 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,* For primary GICs, skip over SGIs. * For secondary GICs, skip over PPIs, too. */ - domain->hwirq_base =32 ; -if (gic_nr ==0 ) { -if ((irq_start &31 ) >0 ) { - domain->hwirq_base =16 ; -if (irq_start !=-1 ) - irq_start = (irq_start & ~31 ) +16 ; - } +if (gic_nr ==0 && (irq_start &31 ) >0 ) { + domain->hwirq_base =16 ;Quoted 8 lines
arch/arm/common/gic.c void __init gic_init_bases(unsigned int gic_nr, int irq_start, · line 703
Quoted 5 lines
arch/arm/common/gic.c +4
-0+if (irq_start !=-1 ) + irq_start = (irq_start & ~31 ) +16 ; + }else { + domain->hwirq_base =32 ; }This should probably just be rolled into Grant's irqdomain work. In any case, it's going to conflict with it.
Quoted 2 lines
Ok, it's purely cosmetic so I'm fine with that. Grant - would you be able to pick this up please?
The conflict is pretty trivial and I'll handle any fixups if a conflict occurs. I'd rather not have changes unrelated to the conversion in my series.
g.
PATCH 1/1 ARM: gic: refactor irq_start assignment
Quoted 6 lines · Grant Likely
Quoted 5 lines · Will Deacon
Quoted 3 lines · Rob Herring
This should probably just be rolled into Grant's irqdomain work. In any case, it's going to conflict with it.
Quoted 6 lines
Quoted 2 lines
Ok, it's purely cosmetic so I'm fine with that. Grant - would you be able to pick this up please?
The conflict is pretty trivial and I'll handle any fixups if a conflict occurs. I'd rather not have changes unrelated to the conversion in my series.
Okey doke then, I'll stick to the original plan (via Russell's patch system) :)
Thanks,
Will