Skip to contentSkip to conversation

mpic: fix ambiguous else statement

PATCH Superseded Anton Vorontsov 2 participants 3 messages May 23, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpic: fix ambiguous else statement

This patch fixes following warning introduced by
commit 475ca391b490a683d66bf19999a8a7a24913f139 (mpic: Deal with bogus NIRQ in Feature Reporting Register):

CC arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function ‘mpic_alloc’:
arch/powerpc/sysdev/mpic.c:1146: warning: suggest explicit braces to avoid ambiguous ‘else’

---
 arch/powerpc/sysdev/mpic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/mpic.c +2 -1
index f99f81a..a281341 100644
@@ -1143,13 +1143,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 	greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
 	mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
 			  >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
-	if (isu_size == 0)
+	if (isu_size == 0) {
 		if (flags & MPIC_BROKEN_FRR_NIRQS)
 			mpic->num_sources = mpic->irq_count;
 		else
 			mpic->num_sources =
 				((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
 				 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
+	}
 
 	/* Map the per-CPU registers */
 	for (i = 0; i < mpic->num_cpus; i++) {
Signature · 1 line
1.5.5.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Anton Vorontsov

This patch fixes following warning introduced by
commit 475ca391b490a683d66bf19999a8a7a24913f139 (mpic: Deal with =20 bogus NIRQ
in Feature Reporting Register):

Quoted 7 lines

CC arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function =E2=80=98mpic_alloc=E2=80=99:
arch/powerpc/sysdev/mpic.c:1146: warning: suggest explicit braces to =20=

avoid ambiguous =E2=80=98else=E2=80=99

as pointed at to me if you set LANG=3DC in your environment gcc will =20 stop spitting out the funny chars.

- k

#2 lore raw

PATCH v2 1/1 mpic: fix ambiguous else statement

This patch fixes following warning introduced by
commit 475ca391b490a683d66bf19999a8a7a24913f139 (mpic: Deal with bogus NIRQ in Feature Reporting Register):

CC arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function 'mpic_alloc':
arch/powerpc/sysdev/mpic.c:1146: warning: suggest explicit braces to avoid ambiguous 'else'

---

Quoted 13 lines · Kumar Gala
Quoted 10 lines · Anton Vorontsov

This patch fixes following warning introduced by
commit 475ca391b490a683d66bf19999a8a7a24913f139 (mpic: Deal with bogus NIRQ
in Feature Reporting Register):

CC arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function ‘mpic_alloc’:
arch/powerpc/sysdev/mpic.c:1146: warning: suggest explicit braces to avoid ambiguous ‘else’

Quoted 6 lines
Quoted 1 line

as pointed at to me if you set LANG=C in your environment gcc will stop spitting out the funny chars.

Ok, resending with Ack and non-unicode gcc warning. Also Cc'ing Paul (forgot last time).

 arch/powerpc/sysdev/mpic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/mpic.c +2 -1
index f99f81a..a281341 100644
@@ -1143,13 +1143,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 	greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
 	mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
 			  >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
-	if (isu_size == 0)
+	if (isu_size == 0) {
 		if (flags & MPIC_BROKEN_FRR_NIRQS)
 			mpic->num_sources = mpic->irq_count;
 		else
 			mpic->num_sources =
 				((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
 				 >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
+	}
 
 	/* Map the per-CPU registers */
 	for (i = 0; i < mpic->num_cpus; i++) {
Signature · 1 line
1.5.5.1