target/ppc/excp_helper: Add a fallthrough for fix compiler warning
PATCH 1/1 target/ppc/excp_helper: Add a fallthrough for fix compiler warning
When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:../target/ppc/excp_helper.c: In function ‘powerpc_excp’:../target/ppc/excp_helper.c:529:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
529 | msr |= env->error_code;
| ~~~~^~~~~~~~~~~~~~~~~~
../target/ppc/excp_helper.c:530:5: note: here
530 | case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */
| ^~~~Add the corresponding "fall through" comment to fix it.
Reported-by Euler Robot <[email protected]>
Signed-off-by Chen Qun <[email protected]>
--- target/ppc/excp_helper.c | 1 + 1 file changed, 1 insertion(+)
target/ppc/excp_helper.c +1 -0
@@ -527,6 +527,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)break ;case POWERPC_EXCP_HISI :/* Hypervisor instruction storage exception */ msr |= env->error_code; +/* fall through */ case POWERPC_EXCP_HDECR :/* Hypervisor decrementer exception */ case POWERPC_EXCP_HDSI :/* Hypervisor data storage exception */ case POWERPC_EXCP_HDSEG :/* Hypervisor data segment exception */
Signature · 1 line
2.23.0
David Gibson
AppliedQuoted 9 lines · Chen Qun
When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
../target/ppc/excp_helper.c: In function ‘powerpc_excp’:../target/ppc/excp_helper.c:529:13: warning: this statement may fall through [-Wimplicit-fallthrough=]529 | msr |= env->error_code; | ~~~~^~~~~~~~~~~~~~~~~~ ../target/ppc/excp_helper.c:530:5: note: here 530 | case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */ | ^~~~
Quoted 4 lines
Add the corresponding "fall through" comment to fix it.
Reported-by Euler Robot <[email protected]>Signed-off-by Chen Qun <[email protected]>
Applied to ppc-for-5.2, thanks.
Quoted 16 lines
--- target/ppc/excp_helper.c | 1 + 1 file changed, 1 insertion(+)target/ppc/excp_helper.c +1
-0@@ -527,6 +527,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)break ;case POWERPC_EXCP_HISI :/* Hypervisor instruction storage exception */ msr |= env->error_code; +/* fall through */ case POWERPC_EXCP_HDECR :/* Hypervisor decrementer exception */ case POWERPC_EXCP_HDSI :/* Hypervisor data storage exception */ case POWERPC_EXCP_HDSEG :/* Hypervisor data segment exception */
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson