Skip to content

Commit df561f6

Browse files
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <[email protected]>
1 parent d012a71 commit df561f6

File tree

1,148 files changed

+2667
-2737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,148 files changed

+2667
-2737
lines changed

arch/alpha/kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
212212
STO_ALPHA_STD_GPLOAD)
213213
/* Omit the prologue. */
214214
value += 8;
215-
/* FALLTHRU */
215+
fallthrough;
216216
case R_ALPHA_BRADDR:
217217
value -= (u64)location + 4;
218218
if (value & 3)

arch/alpha/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ syscall_restart(unsigned long r0, unsigned long r19,
453453
regs->r0 = EINTR;
454454
break;
455455
}
456-
/* fallthrough */
456+
fallthrough;
457457
case ERESTARTNOINTR:
458458
regs->r0 = r0; /* reset v0 and a3 and replay syscall */
459459
regs->r19 = r19;

arch/alpha/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ do_entUnaUser(void __user * va, unsigned long opcode,
883883

884884
case 0x26: /* sts */
885885
fake_reg = s_reg_to_mem(alpha_read_fp_reg(reg));
886-
/* FALLTHRU */
886+
fallthrough;
887887

888888
case 0x2c: /* stl */
889889
__asm__ __volatile__(
@@ -911,7 +911,7 @@ do_entUnaUser(void __user * va, unsigned long opcode,
911911

912912
case 0x27: /* stt */
913913
fake_reg = alpha_read_fp_reg(reg);
914-
/* FALLTHRU */
914+
fallthrough;
915915

916916
case 0x2d: /* stq */
917917
__asm__ __volatile__(

arch/arc/kernel/disasm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void __kprobes disasm_instr(unsigned long addr, struct disasm_state *state,
339339

340340
case op_LDWX_S: /* LDWX_S c, [b, u6] */
341341
state->x = 1;
342-
/* intentional fall-through */
342+
fallthrough;
343343

344344
case op_LDW_S: /* LDW_S c, [b, u6] */
345345
state->zz = 2;

arch/arc/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static void arc_restart_syscall(struct k_sigaction *ka, struct pt_regs *regs)
321321
regs->r0 = -EINTR;
322322
break;
323323
}
324-
/* fallthrough */
324+
fallthrough;
325325

326326
case -ERESTARTNOINTR:
327327
/*

arch/arc/kernel/unwind.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static unsigned long read_pointer(const u8 **pLoc, const void *end,
572572
#else
573573
BUILD_BUG_ON(sizeof(u32) != sizeof(value));
574574
#endif
575-
/* Fall through */
575+
fallthrough;
576576
case DW_EH_PE_native:
577577
if (end < (const void *)(ptr.pul + 1))
578578
return 0;
@@ -827,15 +827,15 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc,
827827
case DW_CFA_def_cfa:
828828
state->cfa.reg = get_uleb128(&ptr.p8, end);
829829
unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg);
830-
/* fall through */
830+
fallthrough;
831831
case DW_CFA_def_cfa_offset:
832832
state->cfa.offs = get_uleb128(&ptr.p8, end);
833833
unw_debug("cfa_def_cfa_offset: 0x%lx ",
834834
state->cfa.offs);
835835
break;
836836
case DW_CFA_def_cfa_sf:
837837
state->cfa.reg = get_uleb128(&ptr.p8, end);
838-
/* fall through */
838+
fallthrough;
839839
case DW_CFA_def_cfa_offset_sf:
840840
state->cfa.offs = get_sleb128(&ptr.p8, end)
841841
* state->dataAlign;

arch/arm/kernel/hw_breakpoint.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static int arch_build_bp_info(struct perf_event *bp,
547547
if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)
548548
&& max_watchpoint_len >= 8)
549549
break;
550-
/* Else, fall through */
550+
fallthrough;
551551
default:
552552
return -EINVAL;
553553
}
@@ -612,12 +612,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
612612
/* Allow halfword watchpoints and breakpoints. */
613613
if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
614614
break;
615-
/* Else, fall through */
615+
fallthrough;
616616
case 3:
617617
/* Allow single byte watchpoint. */
618618
if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
619619
break;
620-
/* Else, fall through */
620+
fallthrough;
621621
default:
622622
ret = -EINVAL;
623623
goto out;
@@ -884,7 +884,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr,
884884
break;
885885
case ARM_ENTRY_ASYNC_WATCHPOINT:
886886
WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
887-
/* Fall through */
887+
fallthrough;
888888
case ARM_ENTRY_SYNC_WATCHPOINT:
889889
watchpoint_handler(addr, fsr, regs);
890890
break;
@@ -933,7 +933,7 @@ static bool core_has_os_save_restore(void)
933933
ARM_DBG_READ(c1, c1, 4, oslsr);
934934
if (oslsr & ARM_OSLSR_OSLM0)
935935
return true;
936-
/* Else, fall through */
936+
fallthrough;
937937
default:
938938
return false;
939939
}

arch/arm/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static int do_signal(struct pt_regs *regs, int syscall)
596596
switch (retval) {
597597
case -ERESTART_RESTARTBLOCK:
598598
restart -= 2;
599-
/* Fall through */
599+
fallthrough;
600600
case -ERESTARTNOHAND:
601601
case -ERESTARTSYS:
602602
case -ERESTARTNOINTR:

arch/arm/mach-ep93xx/crunch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
4949
* FALLTHROUGH: Ensure we don't try to overwrite our newly
5050
* initialised state information on the first fault.
5151
*/
52-
/* Fall through */
52+
fallthrough;
5353

5454
case THREAD_NOTIFY_EXIT:
5555
crunch_task_release(thread);

arch/arm/mach-mmp/pm-mmp2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ void mmp2_pm_enter_lowpower_mode(int state)
123123
case POWER_MODE_SYS_SLEEP:
124124
apcr |= MPMU_PCR_PJ_SLPEN; /* set the SLPEN bit */
125125
apcr |= MPMU_PCR_PJ_VCTCXOSD; /* set VCTCXOSD */
126-
/* fall through */
126+
fallthrough;
127127
case POWER_MODE_CHIP_SLEEP:
128128
apcr |= MPMU_PCR_PJ_SLPEN;
129-
/* fall through */
129+
fallthrough;
130130
case POWER_MODE_APPS_SLEEP:
131131
apcr |= MPMU_PCR_PJ_APBSD; /* set APBSD */
132-
/* fall through */
132+
fallthrough;
133133
case POWER_MODE_APPS_IDLE:
134134
apcr |= MPMU_PCR_PJ_AXISD; /* set AXISDD bit */
135135
apcr |= MPMU_PCR_PJ_DDRCORSD; /* set DDRCORSD bit */
136136
idle_cfg |= APMU_PJ_IDLE_CFG_PJ_PWRDWN; /* PJ power down */
137137
apcr |= MPMU_PCR_PJ_SPSD;
138-
/* fall through */
138+
fallthrough;
139139
case POWER_MODE_CORE_EXTIDLE:
140140
idle_cfg |= APMU_PJ_IDLE_CFG_PJ_IDLE; /* set the IDLE bit */
141141
idle_cfg &= ~APMU_PJ_IDLE_CFG_ISO_MODE_CNTRL_MASK;

0 commit comments

Comments
 (0)