Skip to contentSkip to conversation

MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords

PATCH Superseded Huacai Chen 2 participants 3 messages May 2, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords

The last branch of switch-case doesn't need a "fallthrough" pseudo keyword, and it will cause errors when building a kernel with -Werror:

arch/mips/kernel/perf_event_mipsxx.c: In function 'reset_counters':
include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]

     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

arch/mips/kernel/perf_event_mipsxx.c:932:3: note: in expansion of macro 'fallthrough'

     932 |   fallthrough;
         |   ^~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c: In function 'loongson3_reset_counters':
   include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c:903:3: note: in expansion of macro 'fallthrough'
     903 |   fallthrough;
         |   ^~~~~~~~~~~

cc1: all warnings being treated as errors

Fix it by removing unnecessary "fallthrough" pseudo keywords.

---
 arch/mips/kernel/perf_event_mipsxx.c | 2 --
 1 file changed, 2 deletions(-)
arch/mips/kernel/perf_event_mipsxx.c +0 -2
index a14974c..710b2c7 100644
@@ -900,7 +900,6 @@ static void loongson3_reset_counters(void *arg)
 		mipspmu.write_counter(0, 0);
 		mipsxx_pmu_write_control(0, 575<<5);
 		mipspmu.write_counter(0, 0);
-		fallthrough;
 	}
 }
 
@@ -929,7 +928,6 @@ static void reset_counters(void *arg)
 	case 1:
 		mipsxx_pmu_write_control(0, 0);
 		mipspmu.write_counter(0, 0);
-		fallthrough;
 	}
 }
 
Signature · 1 line
2.7.0
#1 lore raw
Quoted 40 lines · Huacai Chen

The last branch of switch-case doesn't need a "fallthrough" pseudo keyword, and it will cause errors when building a kernel with -Werror:

arch/mips/kernel/perf_event_mipsxx.c: In function 'reset_counters':
include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]

     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

arch/mips/kernel/perf_event_mipsxx.c:932:3: note: in expansion of macro 'fallthrough'

     932 |   fallthrough;
         |   ^~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c: In function 'loongson3_reset_counters':
   include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c:903:3: note: in expansion of macro 'fallthrough'
     903 |   fallthrough;
         |   ^~~~~~~~~~~

cc1: all warnings being treated as errors

Fix it by removing unnecessary "fallthrough" pseudo keywords.

---
 arch/mips/kernel/perf_event_mipsxx.c | 2 --
 1 file changed, 2 deletions(-)
arch/mips/kernel/perf_event_mipsxx.c +0 -1
index a14974c..710b2c7 100644
@@ -900,7 +900,6 @@ static void loongson3_reset_counters(void *arg)
 		mipspmu.write_counter(0, 0);
 		mipsxx_pmu_write_control(0, 575<<5);
 		mipspmu.write_counter(0, 0);
-		fallthrough;
 	}
 }
 

arch/mips/kernel/perf_event_mipsxx.c static void reset_counters(void *arg) · line 932

Quoted 6 lines
arch/mips/kernel/perf_event_mipsxx.c +0 -1
@@ -929,7 +928,6 @@ static void reset_counters(void *arg)
 	case 1:
 		mipsxx_pmu_write_control(0, 0);
 		mipspmu.write_counter(0, 0);
-		fallthrough;
 	}
 }

please add breaks in both places.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
#2 lore raw

OK, I will send V2 soon.

Quoted 56 lines · Thomas Bogendoerfer
Quoted 40 lines · Huacai Chen

The last branch of switch-case doesn't need a "fallthrough" pseudo keyword, and it will cause errors when building a kernel with -Werror:

arch/mips/kernel/perf_event_mipsxx.c: In function 'reset_counters':
include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]

     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

arch/mips/kernel/perf_event_mipsxx.c:932:3: note: in expansion of macro 'fallthrough'

     932 |   fallthrough;
         |   ^~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c: In function 'loongson3_reset_counters':
   include/linux/compiler_attributes.h:200:41: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
     200 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   arch/mips/kernel/perf_event_mipsxx.c:903:3: note: in expansion of macro 'fallthrough'
     903 |   fallthrough;
         |   ^~~~~~~~~~~

cc1: all warnings being treated as errors

Fix it by removing unnecessary "fallthrough" pseudo keywords.

---
 arch/mips/kernel/perf_event_mipsxx.c | 2 --
 1 file changed, 2 deletions(-)
arch/mips/kernel/perf_event_mipsxx.c +0 -1
index a14974c..710b2c7 100644
@@ -900,7 +900,6 @@ static void loongson3_reset_counters(void *arg)
              mipspmu.write_counter(0, 0);
              mipsxx_pmu_write_control(0, 575<<5);
              mipspmu.write_counter(0, 0);
-             fallthrough;
      }
 }
 

arch/mips/kernel/perf_event_mipsxx.c static void reset_counters(void *arg) · line 932

Quoted 6 lines
arch/mips/kernel/perf_event_mipsxx.c +0 -1
@@ -929,7 +928,6 @@ static void reset_counters(void *arg)
      case 1:
              mipsxx_pmu_write_control(0, 0);
              mipspmu.write_counter(0, 0);
-             fallthrough;
      }
 }

please add breaks in both places.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]