x86/kernel: Mark expected switch-case fall-throughs
In preparation to enable -Wimplicit-fallthrough by default, mark switch-case statements where fall-through is intentional, explicitly in order to fix a couple of -Wimplicit-fallthrough warnings. Warning level 3 was used: -Wimplicit-fallthrough=3. [ bp: Massasge and trim commit message. ] Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Baoquan He <bhe@redhat.com> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: David Wang <davidwang@zhaoxin.com> Cc: Douglas Anderson <dianders@chromium.org> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jan Beulich <JBeulich@suse.com> Cc: Kees Cook <keescook@chromium.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Nicolai Stange <nstange@suse.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Pu Wen <puwen@hygon.cn> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20190125183903.GA4712@embeddedorhifive-unleashed-5.1
parent
89da344629
commit
6fcebf1302
|
@ -812,6 +812,7 @@ static int irq_polarity(int idx)
|
||||||
return IOAPIC_POL_HIGH;
|
return IOAPIC_POL_HIGH;
|
||||||
case MP_IRQPOL_RESERVED:
|
case MP_IRQPOL_RESERVED:
|
||||||
pr_warn("IOAPIC: Invalid polarity: 2, defaulting to low\n");
|
pr_warn("IOAPIC: Invalid polarity: 2, defaulting to low\n");
|
||||||
|
/* fall through */
|
||||||
case MP_IRQPOL_ACTIVE_LOW:
|
case MP_IRQPOL_ACTIVE_LOW:
|
||||||
default: /* Pointless default required due to do gcc stupidity */
|
default: /* Pointless default required due to do gcc stupidity */
|
||||||
return IOAPIC_POL_LOW;
|
return IOAPIC_POL_LOW;
|
||||||
|
@ -859,6 +860,7 @@ static int irq_trigger(int idx)
|
||||||
return IOAPIC_EDGE;
|
return IOAPIC_EDGE;
|
||||||
case MP_IRQTRIG_RESERVED:
|
case MP_IRQTRIG_RESERVED:
|
||||||
pr_warn("IOAPIC: Invalid trigger mode 2 defaulting to level\n");
|
pr_warn("IOAPIC: Invalid trigger mode 2 defaulting to level\n");
|
||||||
|
/* fall through */
|
||||||
case MP_IRQTRIG_LEVEL:
|
case MP_IRQTRIG_LEVEL:
|
||||||
default: /* Pointless default required due to do gcc stupidity */
|
default: /* Pointless default required due to do gcc stupidity */
|
||||||
return IOAPIC_LEVEL;
|
return IOAPIC_LEVEL;
|
||||||
|
|
|
@ -248,6 +248,7 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
|
||||||
switch (leaf) {
|
switch (leaf) {
|
||||||
case 1:
|
case 1:
|
||||||
l1 = &l1i;
|
l1 = &l1i;
|
||||||
|
/* fall through */
|
||||||
case 0:
|
case 0:
|
||||||
if (!l1->val)
|
if (!l1->val)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -279,6 +279,7 @@ static int arch_build_bp_info(struct perf_event *bp,
|
||||||
hw->len = X86_BREAKPOINT_LEN_X;
|
hw->len = X86_BREAKPOINT_LEN_X;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -467,6 +467,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
|
||||||
ptr = &remcomInBuffer[1];
|
ptr = &remcomInBuffer[1];
|
||||||
if (kgdb_hex2long(&ptr, &addr))
|
if (kgdb_hex2long(&ptr, &addr))
|
||||||
linux_regs->ip = addr;
|
linux_regs->ip = addr;
|
||||||
|
/* fall through */
|
||||||
case 'D':
|
case 'D':
|
||||||
case 'k':
|
case 'k':
|
||||||
/* clear the trace bit */
|
/* clear the trace bit */
|
||||||
|
|
|
@ -745,6 +745,7 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
|
||||||
* OPCODE1() of the "short" jmp which checks the same condition.
|
* OPCODE1() of the "short" jmp which checks the same condition.
|
||||||
*/
|
*/
|
||||||
opc1 = OPCODE2(insn) - 0x10;
|
opc1 = OPCODE2(insn) - 0x10;
|
||||||
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
if (!is_cond_jmp_opcode(opc1))
|
if (!is_cond_jmp_opcode(opc1))
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
Loading…
Reference in New Issue