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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+3-3
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

+5-5
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

+1-1
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

+1-1
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

+4-4
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;

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -145,23 +145,23 @@ void pxa910_pm_enter_lowpower_mode(int state)
145145
case POWER_MODE_UDR:
146146
/* only shutdown APB in UDR */
147147
apcr |= MPMU_APCR_STBYEN | MPMU_APCR_APBSD;
148-
/* fall through */
148+
fallthrough;
149149
case POWER_MODE_SYS_SLEEP:
150150
apcr |= MPMU_APCR_SLPEN; /* set the SLPEN bit */
151151
apcr |= MPMU_APCR_VCTCXOSD; /* set VCTCXOSD */
152-
/* fall through */
152+
fallthrough;
153153
case POWER_MODE_APPS_SLEEP:
154154
apcr |= MPMU_APCR_DDRCORSD; /* set DDRCORSD */
155-
/* fall through */
155+
fallthrough;
156156
case POWER_MODE_APPS_IDLE:
157157
apcr |= MPMU_APCR_AXISD; /* set AXISDD bit */
158-
/* fall through */
158+
fallthrough;
159159
case POWER_MODE_CORE_EXTIDLE:
160160
idle_cfg |= APMU_MOH_IDLE_CFG_MOH_IDLE;
161161
idle_cfg |= APMU_MOH_IDLE_CFG_MOH_PWRDWN;
162162
idle_cfg |= APMU_MOH_IDLE_CFG_MOH_PWR_SW(3)
163163
| APMU_MOH_IDLE_CFG_MOH_L2_PWR_SW(3);
164-
/* fall through */
164+
fallthrough;
165165
case POWER_MODE_CORE_INTIDLE:
166166
break;
167167
}

arch/arm/mach-omap2/id.c

-8
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ void __init omap3xxx_check_revision(void)
396396
cpu_rev = "3.1";
397397
break;
398398
case 7:
399-
/* FALLTHROUGH */
400399
default:
401400
/* Use the latest known revision as default */
402401
omap_revision = OMAP3430_REV_ES3_1_2;
@@ -416,7 +415,6 @@ void __init omap3xxx_check_revision(void)
416415
cpu_rev = "1.0";
417416
break;
418417
case 1:
419-
/* FALLTHROUGH */
420418
default:
421419
omap_revision = AM35XX_REV_ES1_1;
422420
cpu_rev = "1.1";
@@ -435,7 +433,6 @@ void __init omap3xxx_check_revision(void)
435433
cpu_rev = "1.1";
436434
break;
437435
case 2:
438-
/* FALLTHROUGH */
439436
default:
440437
omap_revision = OMAP3630_REV_ES1_2;
441438
cpu_rev = "1.2";
@@ -456,7 +453,6 @@ void __init omap3xxx_check_revision(void)
456453
cpu_rev = "2.0";
457454
break;
458455
case 3:
459-
/* FALLTHROUGH */
460456
default:
461457
omap_revision = TI8168_REV_ES2_1;
462458
cpu_rev = "2.1";
@@ -473,7 +469,6 @@ void __init omap3xxx_check_revision(void)
473469
cpu_rev = "2.0";
474470
break;
475471
case 2:
476-
/* FALLTHROUGH */
477472
default:
478473
omap_revision = AM335X_REV_ES2_1;
479474
cpu_rev = "2.1";
@@ -491,7 +486,6 @@ void __init omap3xxx_check_revision(void)
491486
cpu_rev = "1.1";
492487
break;
493488
case 2:
494-
/* FALLTHROUGH */
495489
default:
496490
omap_revision = AM437X_REV_ES1_2;
497491
cpu_rev = "1.2";
@@ -502,7 +496,6 @@ void __init omap3xxx_check_revision(void)
502496
case 0xb968:
503497
switch (rev) {
504498
case 0:
505-
/* FALLTHROUGH */
506499
case 1:
507500
omap_revision = TI8148_REV_ES1_0;
508501
cpu_rev = "1.0";
@@ -512,7 +505,6 @@ void __init omap3xxx_check_revision(void)
512505
cpu_rev = "2.0";
513506
break;
514507
case 3:
515-
/* FALLTHROUGH */
516508
default:
517509
omap_revision = TI8148_REV_ES2_1;
518510
cpu_rev = "2.1";

arch/arm/mach-omap2/omap_device.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
240240
if (pdev->dev.of_node)
241241
omap_device_build_from_dt(pdev);
242242
omap_auxdata_legacy_init(dev);
243-
/* fall through */
243+
fallthrough;
244244
default:
245245
od = to_omap_device(pdev);
246246
if (od)

arch/arm/mach-orion5x/dns323-setup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static void __init dns323_init(void)
624624
dns323ab_leds[0].active_low = 1;
625625
gpio_request(DNS323_GPIO_LED_POWER1, "Power Led Enable");
626626
gpio_direction_output(DNS323_GPIO_LED_POWER1, 0);
627-
/* Fall through */
627+
fallthrough;
628628
case DNS323_REV_B1:
629629
i2c_register_board_info(0, dns323ab_i2c_devices,
630630
ARRAY_SIZE(dns323ab_i2c_devices));

arch/arm/mach-rpc/riscpc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static int __init parse_tag_acorn(const struct tag *tag)
4646
switch (tag->u.acorn.vram_pages) {
4747
case 512:
4848
vram_size += PAGE_SIZE * 256;
49-
/* Fall through - ??? */
49+
fallthrough; /* ??? */
5050
case 256:
5151
vram_size += PAGE_SIZE * 256;
5252
default:

arch/arm/mach-tegra/reset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static void __init tegra_cpu_reset_handler_enable(void)
7070
switch (err) {
7171
case -ENOSYS:
7272
tegra_cpu_reset_handler_set(reset_address);
73-
/* fall through */
73+
fallthrough;
7474
case 0:
7575
is_enabled = true;
7676
break;

arch/arm/mm/alignment.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ thumb2arm(u16 tinstr)
694694
return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
695695
(tinstr & 255); /* register_list */
696696
}
697-
/* Else, fall through - for illegal instruction case */
697+
fallthrough; /* for illegal instruction case */
698698

699699
default:
700700
return BAD_INSTR;
@@ -750,7 +750,7 @@ do_alignment_t32_to_handler(u32 *pinstr, struct pt_regs *regs,
750750
case 0xe8e0:
751751
case 0xe9e0:
752752
poffset->un = (tinst2 & 0xff) << 2;
753-
/* Fall through */
753+
fallthrough;
754754

755755
case 0xe940:
756756
case 0xe9c0:

arch/arm/mm/proc-v7-bugs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void cpu_v7_spectre_init(void)
7171
/* Other ARM CPUs require no workaround */
7272
if (read_cpuid_implementor() == ARM_CPU_IMP_ARM)
7373
break;
74-
/* fallthrough */
74+
fallthrough;
7575
/* Cortex A57/A72 require firmware workaround */
7676
case ARM_CPU_PART_CORTEX_A57:
7777
case ARM_CPU_PART_CORTEX_A72: {

arch/arm/plat-omap/dma.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,14 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
309309
* not supported by current hardware on OMAP1
310310
* w |= (0x03 << 7);
311311
*/
312-
/* fall through */
312+
fallthrough;
313313
case OMAP_DMA_DATA_BURST_16:
314314
if (dma_omap2plus()) {
315315
burst = 0x3;
316316
break;
317317
}
318318
/* OMAP1 don't support burst 16 */
319-
/* fall through */
319+
fallthrough;
320320
default:
321321
BUG();
322322
}
@@ -393,7 +393,7 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
393393
break;
394394
}
395395
/* OMAP1 don't support burst 16 */
396-
/* fall through */
396+
fallthrough;
397397
default:
398398
printk(KERN_ERR "Invalid DMA burst mode\n");
399399
BUG();

arch/arm/probes/decode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static bool __kprobes decode_regs(probes_opcode_t *pinsn, u32 regs, bool modify)
307307
case REG_TYPE_NOPCWB:
308308
if (!is_writeback(insn))
309309
break; /* No writeback, so any register is OK */
310-
/* fall through... */
310+
fallthrough;
311311
case REG_TYPE_NOPC:
312312
case REG_TYPE_NOPCX:
313313
/* Reject PC (R15) */

arch/arm/probes/kprobes/core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void __kprobes kprobe_handler(struct pt_regs *regs)
280280
/* A nested probe was hit in FIQ, it is a BUG */
281281
pr_warn("Unrecoverable kprobe detected.\n");
282282
dump_kprobe(p);
283-
/* fall through */
283+
fallthrough;
284284
default:
285285
/* impossible cases */
286286
BUG();

arch/arm64/kernel/acpi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
322322
*/
323323
if (memblock_is_map_memory(phys))
324324
return (void __iomem *)__phys_to_virt(phys);
325-
/* fall through */
325+
fallthrough;
326326

327327
default:
328328
if (region->attribute & EFI_MEMORY_WB)

arch/arm64/kernel/cpufeature.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ static s64 arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp, s64 new,
686686
case FTR_HIGHER_OR_ZERO_SAFE:
687687
if (!cur || !new)
688688
break;
689-
/* Fallthrough */
689+
fallthrough;
690690
case FTR_HIGHER_SAFE:
691691
ret = new > cur ? new : cur;
692692
break;

arch/arm64/kernel/cpuinfo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
327327
set_bit(ICACHEF_VPIPT, &__icache_flags);
328328
break;
329329
default:
330-
/* Fallthrough */
330+
fallthrough;
331331
case ICACHE_POLICY_VIPT:
332332
/* Assume aliasing */
333333
set_bit(ICACHEF_ALIASING, &__icache_flags);

0 commit comments

Comments
 (0)