irqchip/gic-v3: mark expected switch fall-through
Subsystems (2)
PATCH 1/1 irqchip/gic-v3: mark expected switch fall-through
Mark switch cases where we are expecting to fall through, fixes the following warnings:
drivers/irqchip/irq-gic-v3.c: In function ‘gic_cpu_sys_reg_init’:./arch/arm64/include/asm/sysreg.h:853:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
asm volatile(__msr_s(r, "%x0") : : "rZ" (__val)); \
^~~./arch/arm64/include/asm/arch_gicv3.h:20:29: note: in expansion of macro ‘write_sysreg_s’
#define write_gicreg(v, r) write_sysreg_s(v, SYS_ ## r)
^~~~~~~~~~~~~~
drivers/irqchip/irq-gic-v3.c:773:4: note: in expansion of macro ‘write_gicreg’
write_gicreg(0, ICC_AP0R2_EL1);
^~~~~~~~~~~~drivers/irqchip/irq-gic-v3.c:774:3: note: here
case 6:
^~~~
drivers/irqchip/irq-gic-v3.c:788:3: note: in expansion of macro ‘write_gicreg’
write_gicreg(0, ICC_AP1R2_EL1);
^~~~~~~~~~~~
CC net/ipv4/af_inet.odrivers/irqchip/irq-gic-v3.c:789:2: note: here
case 6:
^~~~
./arch/arm64/include/asm/arch_gicv3.h:20:29: note: in expansion of macro ‘write_sysreg_s’
#define write_gicreg(v, r) write_sysreg_s(v, SYS_ ## r)
^~~~~~~~~~~~~~drivers/irqchip/irq-gic-v3.c:790:3: note: in expansion of macro ‘write_gicreg’
write_gicreg(0, ICC_AP1R1_EL1);
^~~~~~~~~~~~drivers/irqchip/irq-gic-v3.c:791:2: note: here
case 5:
^~~~
--- drivers/irqchip/irq-gic-v3.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/irqchip/irq-gic-v3.c +4 -0
@@ -771,8 +771,10 @@ static void gic_cpu_sys_reg_init(void)case 7 :write_gicreg (0 ,ICC_AP0R3_EL1 );write_gicreg (0 ,ICC_AP0R2_EL1 ); +/* fallthrough */ case 6 :write_gicreg (0 ,ICC_AP0R1_EL1 ); +/* fallthrough */ case 5 :case 4 :write_gicreg (0 ,ICC_AP0R0_EL1 );
@@ -786,8 +788,10 @@ static void gic_cpu_sys_reg_init(void)case 7 :write_gicreg (0 ,ICC_AP1R3_EL1 );write_gicreg (0 ,ICC_AP1R2_EL1 ); +/* fallthrough */ case 6 :write_gicreg (0 ,ICC_AP1R1_EL1 ); +/* fallthrough */ case 5 :case 4 :write_gicreg (0 ,ICC_AP1R0_EL1 );
Signature · 1 line
2.21.0
Marc Zyngier
maintainerQuoted 57 lines · Matteo Croce
Mark switch cases where we are expecting to fall through, fixes the following warnings:
drivers/irqchip/irq-gic-v3.c: In function ‘gic_cpu_sys_reg_init’:./arch/arm64/include/asm/sysreg.h:853:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
asmvolatile(__msr_s(r, "%x0") : : "rZ" (__val)); \
^~~./arch/arm64/include/asm/arch_gicv3.h:20:29: note: in expansion of macro ‘write_sysreg_s’#define write_gicreg(v, r) write_sysreg_s(v, SYS_ ## r) ^~~~~~~~~~~~~~ drivers/irqchip/irq-gic-v3.c:773:4: note: in expansion of macro ‘write_gicreg’ write_gicreg(0, ICC_AP0R2_EL1); ^~~~~~~~~~~~ drivers/irqchip/irq-gic-v3.c:774:3: note: here case 6: ^~~~
drivers/irqchip/irq-gic-v3.c:788:3: note: in expansion of macro ‘write_gicreg’write_gicreg(0, ICC_AP1R2_EL1); ^~~~~~~~~~~~CC
net/ipv4/af_inet.odrivers/irqchip/irq-gic-v3.c:789:2: note: here
case 6:
^~~~
./arch/arm64/include/asm/arch_gicv3.h:20:29: note: in expansion of macro ‘write_sysreg_s’#define write_gicreg(v, r) write_sysreg_s(v, SYS_ ## r) ^~~~~~~~~~~~~~ drivers/irqchip/irq-gic-v3.c:790:3: note: in expansion of macro ‘write_gicreg’ write_gicreg(0, ICC_AP1R1_EL1); ^~~~~~~~~~~~
drivers/irqchip/irq-gic-v3.c:791:2: note: here
case 5:
^~~~Signed-off-by Matteo Croce <[email protected]>--- drivers/irqchip/irq-gic-v3.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/irqchip/irq-gic-v3.c +2
-0@@ -771,8 +771,10 @@ static void gic_cpu_sys_reg_init(void)case 7 :write_gicreg (0 ,ICC_AP0R3_EL1 );write_gicreg (0 ,ICC_AP0R2_EL1 ); +/* fallthrough */ case 6 :write_gicreg (0 ,ICC_AP0R1_EL1 ); +/* fallthrough */ case 5 :case 4 :write_gicreg (0 ,ICC_AP0R0_EL1 );
drivers/irqchip/irq-gic-v3.c static void gic_cpu_sys_reg_init(void) · line 797
Quoted 10 lines
drivers/irqchip/irq-gic-v3.c +2
-0@@ -786,8 +788,10 @@ static void gic_cpu_sys_reg_init(void)case 7 :write_gicreg (0 ,ICC_AP1R3_EL1 );write_gicreg (0 ,ICC_AP1R2_EL1 ); +/* fallthrough */ case 6 :write_gicreg (0 ,ICC_AP1R1_EL1 ); +/* fallthrough */ case 5 :case 4 :write_gicreg (0 ,ICC_AP1R0_EL1 );
Already fixed here[1].
M.
Signature · 1 line
Jazz is not dead, it just smells funny...