diff mbox series

[-next,004/491] PERFORMANCE EVENTS SUBSYSTEM: Use fallthrough;

Message ID 73d22360c5c665fd7f480a209ae46807dfb07bbe.1583896348.git.joe@perches.com (mailing list archive)
State Superseded
Headers show
Series None | expand

Commit Message

Joe Perches March 11, 2020, 4:51 a.m. UTC
Convert the various uses of fallthrough comments to fallthrough;

Done via script
Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/mips/kernel/perf_event_mipsxx.c | 6 +++---
 arch/x86/events/intel/core.c         | 7 +++----
 arch/x86/events/intel/lbr.c          | 2 +-
 kernel/events/core.c                 | 3 +--
 4 files changed, 8 insertions(+), 10 deletions(-)

Comments

Peter Zijlstra March 11, 2020, 3:30 p.m. UTC | #1
On Tue, Mar 10, 2020 at 09:51:18PM -0700, Joe Perches wrote:
> Convert the various uses of fallthrough comments to fallthrough;
> 
> Done via script
> Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/
> 
> Signed-off-by: Joe Perches <joe@perches.com>

The subject can use a little less screaming, but the actual patch is
fine.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Thomas Bogendoerfer March 11, 2020, 7:20 p.m. UTC | #2
On Tue, Mar 10, 2020 at 09:51:18PM -0700, Joe Perches wrote:
> Convert the various uses of fallthrough comments to fallthrough;
> 
> Done via script
> Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---

Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Thomas.
Joe Perches March 12, 2020, 6:15 a.m. UTC | #3
On Wed, 2020-03-11 at 16:30 +0100, Peter Zijlstra wrote:
> On Tue, Mar 10, 2020 at 09:51:18PM -0700, Joe Perches wrote:
> > Convert the various uses of fallthrough comments to fallthrough;
> > 
> > Done via script
> > Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> The subject can use a little less screaming, but the actual patch is
> fine.

Patch subject come from the MAINTAINERS subsystem/section heading
because I don't see a better way to script the patch subject that
is more effective.

Using something like:

$ cat get_patch_subject_prefix.bash
#!/bin/bash
git log --format="%s" --no-merges -200 --since=2-years-ago $@ | \
  cut -f1 -d":" | \
  sort  | uniq -c | sort -rn | head -1 | \
  sed 's/^[[:space:]]*[[:digit:]]*[[:space:]]*//'
$

Does well for some sets of files, less well for others.

For instance:

$ ./get_patch_subject_prefix.bash drivers/net/ethernet/intel/
ice

which is just one of 10 or so subsystems of intel/...

And there's no way I'm going to individually edit
~500 patches for every specific maintainer's preference.
diff mbox series

Patch

diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 128fc9..484948 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -790,15 +790,15 @@  static void reset_counters(void *arg)
 	case 4:
 		mipsxx_pmu_write_control(3, 0);
 		mipspmu.write_counter(3, 0);
-		/* fall through */
+		fallthrough;
 	case 3:
 		mipsxx_pmu_write_control(2, 0);
 		mipspmu.write_counter(2, 0);
-		/* fall through */
+		fallthrough;
 	case 2:
 		mipsxx_pmu_write_control(1, 0);
 		mipspmu.write_counter(1, 0);
-		/* fall through */
+		fallthrough;
 	case 1:
 		mipsxx_pmu_write_control(0, 0);
 		mipspmu.write_counter(0, 0);
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 332954..8cd3bb 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -4637,8 +4637,7 @@  __init int intel_pmu_init(void)
 
 	case INTEL_FAM6_CORE2_MEROM:
 		x86_add_quirk(intel_clovertown_quirk);
-		/* fall through */
-
+		fallthrough;
 	case INTEL_FAM6_CORE2_MEROM_L:
 	case INTEL_FAM6_CORE2_PENRYN:
 	case INTEL_FAM6_CORE2_DUNNINGTON:
@@ -5017,7 +5016,7 @@  __init int intel_pmu_init(void)
 
 	case INTEL_FAM6_SKYLAKE_X:
 		pmem = true;
-		/* fall through */
+		fallthrough;
 	case INTEL_FAM6_SKYLAKE_L:
 	case INTEL_FAM6_SKYLAKE:
 	case INTEL_FAM6_KABYLAKE_L:
@@ -5069,7 +5068,7 @@  __init int intel_pmu_init(void)
 	case INTEL_FAM6_ICELAKE_X:
 	case INTEL_FAM6_ICELAKE_D:
 		pmem = true;
-		/* fall through */
+		fallthrough;
 	case INTEL_FAM6_ICELAKE_L:
 	case INTEL_FAM6_ICELAKE:
 	case INTEL_FAM6_TIGERLAKE_L:
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index 65113b1..2e2c6fb 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -967,7 +967,7 @@  static int branch_type(unsigned long from, unsigned long to, int abort)
 			ret = X86_BR_ZERO_CALL;
 			break;
 		}
-		/* fall through */
+		fallthrough;
 	case 0x9a: /* call far absolute */
 		ret = X86_BR_CALL;
 		break;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6a47c3..7a8ed4d5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9762,8 +9762,7 @@  perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 		case IF_SRC_KERNELADDR:
 		case IF_SRC_KERNEL:
 			kernel = 1;
-			/* fall through */
-
+			fallthrough;
 		case IF_SRC_FILEADDR:
 		case IF_SRC_FILE:
 			if (state != IF_STATE_SOURCE)