Skip to content

Commit 7c9eb2d

Browse files
nds32: Mark expected switch fall-throughs
Mark switch cases where we are expecting to fall through. This patch fixes the following warnings (Building: allmodconfig nds32): include/math-emu/soft-fp.h:124:8: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/nds32/kernel/signal.c:362:20: warning: this statement may fall through [-Wimplicit-fallthrough=] arch/nds32/kernel/signal.c:315:7: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:417:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:430:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:310:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:320:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:310:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:320:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/soft-fp.h:124:8: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:417:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:430:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:310:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:320:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:310:11: warning: this statement may fall through [-Wimplicit-fallthrough=] include/math-emu/op-common.h:320:11: warning: this statement may fall through [-Wimplicit-fallthrough=] Reported-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
1 parent 00a0c84 commit 7c9eb2d

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎arch/nds32/kernel/signal.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
316316
regs->uregs[0] = -EINTR;
317317
break;
318318
}
319+
/* Else, fall through */
319320
case -ERESTARTNOINTR:
320321
regs->uregs[0] = regs->orig_r0;
321322
regs->ipc -= 4;
@@ -360,6 +361,7 @@ static void do_signal(struct pt_regs *regs)
360361
switch (regs->uregs[0]) {
361362
case -ERESTART_RESTARTBLOCK:
362363
regs->uregs[15] = __NR_restart_syscall;
364+
/* Fall through */
363365
case -ERESTARTNOHAND:
364366
case -ERESTARTSYS:
365367
case -ERESTARTNOINTR:

‎include/math-emu/op-common.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ do { \
308308
\
309309
case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
310310
R##_e = X##_e; \
311+
/* Fall through */ \
311312
case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \
312313
case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \
313314
case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \
@@ -318,6 +319,7 @@ do { \
318319
\
319320
case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \
320321
R##_e = Y##_e; \
322+
/* Fall through */ \
321323
case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \
322324
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \
323325
case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \
@@ -415,6 +417,7 @@ do { \
415417
case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \
416418
case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \
417419
R##_s = X##_s; \
420+
/* Fall through */ \
418421
\
419422
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \
420423
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \
@@ -428,6 +431,7 @@ do { \
428431
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \
429432
case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \
430433
R##_s = Y##_s; \
434+
/* Fall through */ \
431435
\
432436
case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \
433437
case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
@@ -493,6 +497,7 @@ do { \
493497
\
494498
case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \
495499
FP_SET_EXCEPTION(FP_EX_DIVZERO); \
500+
/* Fall through */ \
496501
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \
497502
case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \
498503
R##_c = FP_CLS_INF; \

0 commit comments

Comments
 (0)