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
This commit is contained in:
Родитель
1aeba347b3
Коммит
69095e3900
|
@ -451,6 +451,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case bltzl_op:
|
case bltzl_op:
|
||||||
if (NO_R6EMU)
|
if (NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case bltz_op:
|
case bltz_op:
|
||||||
if ((long)regs->regs[insn.i_format.rs] < 0) {
|
if ((long)regs->regs[insn.i_format.rs] < 0) {
|
||||||
epc = epc + 4 + (insn.i_format.simmediate << 2);
|
epc = epc + 4 + (insn.i_format.simmediate << 2);
|
||||||
|
@ -464,6 +465,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case bgezl_op:
|
case bgezl_op:
|
||||||
if (NO_R6EMU)
|
if (NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case bgez_op:
|
case bgez_op:
|
||||||
if ((long)regs->regs[insn.i_format.rs] >= 0) {
|
if ((long)regs->regs[insn.i_format.rs] >= 0) {
|
||||||
epc = epc + 4 + (insn.i_format.simmediate << 2);
|
epc = epc + 4 + (insn.i_format.simmediate << 2);
|
||||||
|
@ -559,6 +561,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case jalx_op:
|
case jalx_op:
|
||||||
case jal_op:
|
case jal_op:
|
||||||
regs->regs[31] = regs->cp0_epc + 8;
|
regs->regs[31] = regs->cp0_epc + 8;
|
||||||
|
/* fall through */
|
||||||
case j_op:
|
case j_op:
|
||||||
epc += 4;
|
epc += 4;
|
||||||
epc >>= 28;
|
epc >>= 28;
|
||||||
|
@ -575,6 +578,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case beql_op:
|
case beql_op:
|
||||||
if (NO_R6EMU)
|
if (NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case beq_op:
|
case beq_op:
|
||||||
if (regs->regs[insn.i_format.rs] ==
|
if (regs->regs[insn.i_format.rs] ==
|
||||||
regs->regs[insn.i_format.rt]) {
|
regs->regs[insn.i_format.rt]) {
|
||||||
|
@ -589,6 +593,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case bnel_op:
|
case bnel_op:
|
||||||
if (NO_R6EMU)
|
if (NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case bne_op:
|
case bne_op:
|
||||||
if (regs->regs[insn.i_format.rs] !=
|
if (regs->regs[insn.i_format.rs] !=
|
||||||
regs->regs[insn.i_format.rt]) {
|
regs->regs[insn.i_format.rt]) {
|
||||||
|
@ -603,6 +608,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case blezl_op: /* not really i_format */
|
case blezl_op: /* not really i_format */
|
||||||
if (!insn.i_format.rt && NO_R6EMU)
|
if (!insn.i_format.rt && NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case blez_op:
|
case blez_op:
|
||||||
/*
|
/*
|
||||||
* Compact branches for R6 for the
|
* Compact branches for R6 for the
|
||||||
|
@ -638,6 +644,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
|
||||||
case bgtzl_op:
|
case bgtzl_op:
|
||||||
if (!insn.i_format.rt && NO_R6EMU)
|
if (!insn.i_format.rt && NO_R6EMU)
|
||||||
goto sigill_r2r6;
|
goto sigill_r2r6;
|
||||||
|
/* fall through */
|
||||||
case bgtz_op:
|
case bgtz_op:
|
||||||
/*
|
/*
|
||||||
* Compact branches for R6 for the
|
* Compact branches for R6 for the
|
||||||
|
|
|
@ -517,12 +517,16 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
|
||||||
switch (isa) {
|
switch (isa) {
|
||||||
case MIPS_CPU_ISA_M64R2:
|
case MIPS_CPU_ISA_M64R2:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2;
|
c->isa_level |= MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_M64R1:
|
case MIPS_CPU_ISA_M64R1:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1;
|
c->isa_level |= MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_V:
|
case MIPS_CPU_ISA_V:
|
||||||
c->isa_level |= MIPS_CPU_ISA_V;
|
c->isa_level |= MIPS_CPU_ISA_V;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_IV:
|
case MIPS_CPU_ISA_IV:
|
||||||
c->isa_level |= MIPS_CPU_ISA_IV;
|
c->isa_level |= MIPS_CPU_ISA_IV;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_III:
|
case MIPS_CPU_ISA_III:
|
||||||
c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III;
|
c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III;
|
||||||
break;
|
break;
|
||||||
|
@ -530,14 +534,17 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
|
||||||
/* R6 incompatible with everything else */
|
/* R6 incompatible with everything else */
|
||||||
case MIPS_CPU_ISA_M64R6:
|
case MIPS_CPU_ISA_M64R6:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6;
|
c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_M32R6:
|
case MIPS_CPU_ISA_M32R6:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R6;
|
c->isa_level |= MIPS_CPU_ISA_M32R6;
|
||||||
/* Break here so we don't add incompatible ISAs */
|
/* Break here so we don't add incompatible ISAs */
|
||||||
break;
|
break;
|
||||||
case MIPS_CPU_ISA_M32R2:
|
case MIPS_CPU_ISA_M32R2:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R2;
|
c->isa_level |= MIPS_CPU_ISA_M32R2;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_M32R1:
|
case MIPS_CPU_ISA_M32R1:
|
||||||
c->isa_level |= MIPS_CPU_ISA_M32R1;
|
c->isa_level |= MIPS_CPU_ISA_M32R1;
|
||||||
|
/* fall through */
|
||||||
case MIPS_CPU_ISA_II:
|
case MIPS_CPU_ISA_II:
|
||||||
c->isa_level |= MIPS_CPU_ISA_II;
|
c->isa_level |= MIPS_CPU_ISA_II;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -27,12 +27,15 @@ void mips_install_watch_registers(struct task_struct *t)
|
||||||
case 4:
|
case 4:
|
||||||
write_c0_watchlo3(watches->watchlo[3]);
|
write_c0_watchlo3(watches->watchlo[3]);
|
||||||
write_c0_watchhi3(watchhi | watches->watchhi[3]);
|
write_c0_watchhi3(watchhi | watches->watchhi[3]);
|
||||||
|
/* fall through */
|
||||||
case 3:
|
case 3:
|
||||||
write_c0_watchlo2(watches->watchlo[2]);
|
write_c0_watchlo2(watches->watchlo[2]);
|
||||||
write_c0_watchhi2(watchhi | watches->watchhi[2]);
|
write_c0_watchhi2(watchhi | watches->watchhi[2]);
|
||||||
|
/* fall through */
|
||||||
case 2:
|
case 2:
|
||||||
write_c0_watchlo1(watches->watchlo[1]);
|
write_c0_watchlo1(watches->watchlo[1]);
|
||||||
write_c0_watchhi1(watchhi | watches->watchhi[1]);
|
write_c0_watchhi1(watchhi | watches->watchhi[1]);
|
||||||
|
/* fall through */
|
||||||
case 1:
|
case 1:
|
||||||
write_c0_watchlo0(watches->watchlo[0]);
|
write_c0_watchlo0(watches->watchlo[0]);
|
||||||
write_c0_watchhi0(watchhi | watches->watchhi[0]);
|
write_c0_watchhi0(watchhi | watches->watchhi[0]);
|
||||||
|
@ -55,10 +58,13 @@ void mips_read_watch_registers(void)
|
||||||
BUG();
|
BUG();
|
||||||
case 4:
|
case 4:
|
||||||
watches->watchhi[3] = (read_c0_watchhi3() & watchhi_mask);
|
watches->watchhi[3] = (read_c0_watchhi3() & watchhi_mask);
|
||||||
|
/* fall through */
|
||||||
case 3:
|
case 3:
|
||||||
watches->watchhi[2] = (read_c0_watchhi2() & watchhi_mask);
|
watches->watchhi[2] = (read_c0_watchhi2() & watchhi_mask);
|
||||||
|
/* fall through */
|
||||||
case 2:
|
case 2:
|
||||||
watches->watchhi[1] = (read_c0_watchhi1() & watchhi_mask);
|
watches->watchhi[1] = (read_c0_watchhi1() & watchhi_mask);
|
||||||
|
/* fall through */
|
||||||
case 1:
|
case 1:
|
||||||
watches->watchhi[0] = (read_c0_watchhi0() & watchhi_mask);
|
watches->watchhi[0] = (read_c0_watchhi0() & watchhi_mask);
|
||||||
}
|
}
|
||||||
|
@ -85,18 +91,25 @@ void mips_clear_watch_registers(void)
|
||||||
BUG();
|
BUG();
|
||||||
case 8:
|
case 8:
|
||||||
write_c0_watchlo7(0);
|
write_c0_watchlo7(0);
|
||||||
|
/* fall through */
|
||||||
case 7:
|
case 7:
|
||||||
write_c0_watchlo6(0);
|
write_c0_watchlo6(0);
|
||||||
|
/* fall through */
|
||||||
case 6:
|
case 6:
|
||||||
write_c0_watchlo5(0);
|
write_c0_watchlo5(0);
|
||||||
|
/* fall through */
|
||||||
case 5:
|
case 5:
|
||||||
write_c0_watchlo4(0);
|
write_c0_watchlo4(0);
|
||||||
|
/* fall through */
|
||||||
case 4:
|
case 4:
|
||||||
write_c0_watchlo3(0);
|
write_c0_watchlo3(0);
|
||||||
|
/* fall through */
|
||||||
case 3:
|
case 3:
|
||||||
write_c0_watchlo2(0);
|
write_c0_watchlo2(0);
|
||||||
|
/* fall through */
|
||||||
case 2:
|
case 2:
|
||||||
write_c0_watchlo1(0);
|
write_c0_watchlo1(0);
|
||||||
|
/* fall through */
|
||||||
case 1:
|
case 1:
|
||||||
write_c0_watchlo0(0);
|
write_c0_watchlo0(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1280,6 +1280,7 @@ static void probe_pcache(void)
|
||||||
|
|
||||||
case CPU_VR4133:
|
case CPU_VR4133:
|
||||||
write_c0_config(config & ~VR41_CONF_P4K);
|
write_c0_config(config & ~VR41_CONF_P4K);
|
||||||
|
/* fall through */
|
||||||
case CPU_VR4131:
|
case CPU_VR4131:
|
||||||
/* Workaround for cache instruction bug of VR4131 */
|
/* Workaround for cache instruction bug of VR4131 */
|
||||||
if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
|
if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
|
||||||
|
@ -1527,6 +1528,7 @@ static void probe_pcache(void)
|
||||||
c->dcache.flags |= MIPS_CACHE_PINDEX;
|
c->dcache.flags |= MIPS_CACHE_PINDEX;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
if (has_74k_erratum || c->dcache.waysize > PAGE_SIZE)
|
if (has_74k_erratum || c->dcache.waysize > PAGE_SIZE)
|
||||||
c->dcache.flags |= MIPS_CACHE_ALIASES;
|
c->dcache.flags |= MIPS_CACHE_ALIASES;
|
||||||
|
|
|
@ -576,6 +576,7 @@ void build_tlb_write_entry(u32 **p, struct uasm_label **l,
|
||||||
case CPU_R5500:
|
case CPU_R5500:
|
||||||
if (m4kc_tlbp_war())
|
if (m4kc_tlbp_war())
|
||||||
uasm_i_nop(p);
|
uasm_i_nop(p);
|
||||||
|
/* fall through */
|
||||||
case CPU_ALCHEMY:
|
case CPU_ALCHEMY:
|
||||||
tlbw(p);
|
tlbw(p);
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче