Commit 2bf74771 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'fallthrough-pseudo-keyword-5.9-rc3' of...

Merge tag 'fallthrough-pseudo-keyword-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux

Pull 'fallthrough' keyword conversion from Gustavo A. R. Silva:
 "A tree-wide patch that replaces tons (2484) of /* 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.

  There are currently 1167 intances of this fallthrough pseudo-keyword
  macro in mainline (5.9-rc2), that have been introduced over the last
  couple of development cycles:

    $ git grep -nw 'fallthrough;' | wc -l
    1167

  The global adoption of the fallthrough pseudo-keyword is something
  certain to happen; so, better sooner than later. :) This will also
  save everybody's time and thousands of lines of unnecessarily
  repetitive changelog text.

  After applying this patch on top of 5.9-rc2, we'll have a total of
  3651 instances of this macro:

    $ git grep -nw 'fallthrough;' | wc -l
    3651

  This treewide patch doesn't address ALL fall-through markings in all
  subsystems at once because I have previously sent out patches for some
  of such subsystems separately, and I will follow up on them; however,
  this definitely contributes most of the work needed to replace all the
  fall-through markings with the fallthrough pseudo-keyword macro in the
  whole codebase.

  I have build-tested this patch on 10 different architectures: x86_64,
  i386, arm64, powerpc, s390, sparc64, sh, m68k, powerpc64 and alpha
  (allyesconfig for all of them). This is in linux-next already and
  kernel test robot has also helped me to successfully build-test early
  versions of this patch[2][3][4][5]"

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
[2] https://lore.kernel.org/lkml/5f3cc99a.HgvOW3rH0mD0RmkM%25lkp@intel.com/
[3] https://lore.kernel.org/lkml/5f3dd1d2.l1axczH+t4hMBZ63%25lkp@intel.com/
[4] https://lore.kernel.org/lkml/5f3e977a.mwYHUIObbR4SHr0B%25lkp@intel.com/
[5] https://lore.kernel.org/lkml/5f3f9e1c.qsyb%2FaySkiXNpkO4%25lkp@intel.com/

* tag 'fallthrough-pseudo-keyword-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  treewide: Use fallthrough pseudo-keyword
parents d012a719 df561f66
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
			    STO_ALPHA_STD_GPLOAD)
				/* Omit the prologue. */
				value += 8;
			/* FALLTHRU */
			fallthrough;
		case R_ALPHA_BRADDR:
			value -= (u64)location + 4;
			if (value & 3)
+1 −1
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ syscall_restart(unsigned long r0, unsigned long r19,
			regs->r0 = EINTR;
			break;
		}
		/* fallthrough */
		fallthrough;
	case ERESTARTNOINTR:
		regs->r0 = r0;	/* reset v0 and a3 and replay syscall */
		regs->r19 = r19;
+2 −2
Original line number Diff line number Diff line
@@ -883,7 +883,7 @@ do_entUnaUser(void __user * va, unsigned long opcode,

	case 0x26: /* sts */
		fake_reg = s_reg_to_mem(alpha_read_fp_reg(reg));
		/* FALLTHRU */
		fallthrough;

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

	case 0x27: /* stt */
		fake_reg = alpha_read_fp_reg(reg);
		/* FALLTHRU */
		fallthrough;

	case 0x2d: /* stq */
		__asm__ __volatile__(
+1 −1
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ void __kprobes disasm_instr(unsigned long addr, struct disasm_state *state,

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

	case op_LDW_S:	/* LDW_S c, [b, u6] */
		state->zz = 2;
+1 −1
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ static void arc_restart_syscall(struct k_sigaction *ka, struct pt_regs *regs)
			regs->r0 = -EINTR;
			break;
		}
		/* fallthrough */
		fallthrough;

	case -ERESTARTNOINTR:
		/*
Loading