Skip to contentSkip to conversation

ARM: gic: refactor irq_start assignment

PATCH New Will Deacon 3 participants 5 messages Jan 17, 2012 – Jan 19, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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
index c47d619..ca6b5dd 100644
@@ -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
#1 lore raw

PATCH 1/1 ARM: gic: refactor irq_start assignment

Quoted 23 lines · Will Deacon

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 +0 -4
index c47d619..ca6b5dd 100644
@@ -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

#2 lore raw

PATCH 1/1 ARM: gic: refactor irq_start assignment

Quoted 29 lines · Rob Herring
Quoted 28 lines · Will Deacon

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 +2 -7
index c47d619..ca6b5dd 100644
@@ -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

#3 lore raw

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_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 +2 -7
index c47d619..ca6b5dd 100644
@@ -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.

#4 lore raw

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