Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mips: annotate implicit fall throughs

There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings. Fix them up.

This patch produces no change in behaviour, but should be reviewed in
case these are actually bugs not intentional fallthoughs.

Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Kees Cook <keescook@google.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Mathieu Malaterre and committed by
Paul Burton
69095e39 1aeba347

+30
+7
arch/mips/kernel/branch.c
··· 451 451 case bltzl_op: 452 452 if (NO_R6EMU) 453 453 goto sigill_r2r6; 454 + /* fall through */ 454 455 case bltz_op: 455 456 if ((long)regs->regs[insn.i_format.rs] < 0) { 456 457 epc = epc + 4 + (insn.i_format.simmediate << 2); ··· 465 464 case bgezl_op: 466 465 if (NO_R6EMU) 467 466 goto sigill_r2r6; 467 + /* fall through */ 468 468 case bgez_op: 469 469 if ((long)regs->regs[insn.i_format.rs] >= 0) { 470 470 epc = epc + 4 + (insn.i_format.simmediate << 2); ··· 561 559 case jalx_op: 562 560 case jal_op: 563 561 regs->regs[31] = regs->cp0_epc + 8; 562 + /* fall through */ 564 563 case j_op: 565 564 epc += 4; 566 565 epc >>= 28; ··· 578 575 case beql_op: 579 576 if (NO_R6EMU) 580 577 goto sigill_r2r6; 578 + /* fall through */ 581 579 case beq_op: 582 580 if (regs->regs[insn.i_format.rs] == 583 581 regs->regs[insn.i_format.rt]) { ··· 593 589 case bnel_op: 594 590 if (NO_R6EMU) 595 591 goto sigill_r2r6; 592 + /* fall through */ 596 593 case bne_op: 597 594 if (regs->regs[insn.i_format.rs] != 598 595 regs->regs[insn.i_format.rt]) { ··· 608 603 case blezl_op: /* not really i_format */ 609 604 if (!insn.i_format.rt && NO_R6EMU) 610 605 goto sigill_r2r6; 606 + /* fall through */ 611 607 case blez_op: 612 608 /* 613 609 * Compact branches for R6 for the ··· 644 638 case bgtzl_op: 645 639 if (!insn.i_format.rt && NO_R6EMU) 646 640 goto sigill_r2r6; 641 + /* fall through */ 647 642 case bgtz_op: 648 643 /* 649 644 * Compact branches for R6 for the
+7
arch/mips/kernel/cpu-probe.c
··· 517 517 switch (isa) { 518 518 case MIPS_CPU_ISA_M64R2: 519 519 c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2; 520 + /* fall through */ 520 521 case MIPS_CPU_ISA_M64R1: 521 522 c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1; 523 + /* fall through */ 522 524 case MIPS_CPU_ISA_V: 523 525 c->isa_level |= MIPS_CPU_ISA_V; 526 + /* fall through */ 524 527 case MIPS_CPU_ISA_IV: 525 528 c->isa_level |= MIPS_CPU_ISA_IV; 529 + /* fall through */ 526 530 case MIPS_CPU_ISA_III: 527 531 c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; 528 532 break; ··· 534 530 /* R6 incompatible with everything else */ 535 531 case MIPS_CPU_ISA_M64R6: 536 532 c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6; 533 + /* fall through */ 537 534 case MIPS_CPU_ISA_M32R6: 538 535 c->isa_level |= MIPS_CPU_ISA_M32R6; 539 536 /* Break here so we don't add incompatible ISAs */ 540 537 break; 541 538 case MIPS_CPU_ISA_M32R2: 542 539 c->isa_level |= MIPS_CPU_ISA_M32R2; 540 + /* fall through */ 543 541 case MIPS_CPU_ISA_M32R1: 544 542 c->isa_level |= MIPS_CPU_ISA_M32R1; 543 + /* fall through */ 545 544 case MIPS_CPU_ISA_II: 546 545 c->isa_level |= MIPS_CPU_ISA_II; 547 546 break;
+13
arch/mips/kernel/watch.c
··· 27 27 case 4: 28 28 write_c0_watchlo3(watches->watchlo[3]); 29 29 write_c0_watchhi3(watchhi | watches->watchhi[3]); 30 + /* fall through */ 30 31 case 3: 31 32 write_c0_watchlo2(watches->watchlo[2]); 32 33 write_c0_watchhi2(watchhi | watches->watchhi[2]); 34 + /* fall through */ 33 35 case 2: 34 36 write_c0_watchlo1(watches->watchlo[1]); 35 37 write_c0_watchhi1(watchhi | watches->watchhi[1]); 38 + /* fall through */ 36 39 case 1: 37 40 write_c0_watchlo0(watches->watchlo[0]); 38 41 write_c0_watchhi0(watchhi | watches->watchhi[0]); ··· 58 55 BUG(); 59 56 case 4: 60 57 watches->watchhi[3] = (read_c0_watchhi3() & watchhi_mask); 58 + /* fall through */ 61 59 case 3: 62 60 watches->watchhi[2] = (read_c0_watchhi2() & watchhi_mask); 61 + /* fall through */ 63 62 case 2: 64 63 watches->watchhi[1] = (read_c0_watchhi1() & watchhi_mask); 64 + /* fall through */ 65 65 case 1: 66 66 watches->watchhi[0] = (read_c0_watchhi0() & watchhi_mask); 67 67 } ··· 91 85 BUG(); 92 86 case 8: 93 87 write_c0_watchlo7(0); 88 + /* fall through */ 94 89 case 7: 95 90 write_c0_watchlo6(0); 91 + /* fall through */ 96 92 case 6: 97 93 write_c0_watchlo5(0); 94 + /* fall through */ 98 95 case 5: 99 96 write_c0_watchlo4(0); 97 + /* fall through */ 100 98 case 4: 101 99 write_c0_watchlo3(0); 100 + /* fall through */ 102 101 case 3: 103 102 write_c0_watchlo2(0); 103 + /* fall through */ 104 104 case 2: 105 105 write_c0_watchlo1(0); 106 + /* fall through */ 106 107 case 1: 107 108 write_c0_watchlo0(0); 108 109 }
+2
arch/mips/mm/c-r4k.c
··· 1280 1280 1281 1281 case CPU_VR4133: 1282 1282 write_c0_config(config & ~VR41_CONF_P4K); 1283 + /* fall through */ 1283 1284 case CPU_VR4131: 1284 1285 /* Workaround for cache instruction bug of VR4131 */ 1285 1286 if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U || ··· 1528 1527 c->dcache.flags |= MIPS_CACHE_PINDEX; 1529 1528 break; 1530 1529 } 1530 + /* fall through */ 1531 1531 default: 1532 1532 if (has_74k_erratum || c->dcache.waysize > PAGE_SIZE) 1533 1533 c->dcache.flags |= MIPS_CACHE_ALIASES;
+1
arch/mips/mm/tlbex.c
··· 576 576 case CPU_R5500: 577 577 if (m4kc_tlbp_war()) 578 578 uasm_i_nop(p); 579 + /* fall through */ 579 580 case CPU_ALCHEMY: 580 581 tlbw(p); 581 582 break;