* [PATCH] MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords
@ 2020-05-02 4:55 Huacai Chen
2020-05-02 10:04 ` Thomas Bogendoerfer
0 siblings, 1 reply; 3+ messages in thread
From: Huacai Chen @ 2020-05-02 4:55 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang,
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__))
| ^~~~~~~~~~~~~
>> 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.
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
arch/mips/kernel/perf_event_mipsxx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index a14974c..710b2c7 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -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;
}
}
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords
2020-05-02 4:55 [PATCH] MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords Huacai Chen
@ 2020-05-02 10:04 ` Thomas Bogendoerfer
2020-05-02 10:42 ` Huacai Chen
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2020-05-02 10:04 UTC (permalink / raw)
To: Huacai Chen
Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang
On Sat, May 02, 2020 at 12:55:26PM +0800, Huacai Chen wrote:
> 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__))
> | ^~~~~~~~~~~~~
> >> 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.
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> arch/mips/kernel/perf_event_mipsxx.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
> index a14974c..710b2c7 100644
> --- a/arch/mips/kernel/perf_event_mipsxx.c
> +++ b/arch/mips/kernel/perf_event_mipsxx.c
> @@ -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;
> }
> }
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 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords
2020-05-02 10:04 ` Thomas Bogendoerfer
@ 2020-05-02 10:42 ` Huacai Chen
0 siblings, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2020-05-02 10:42 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: open list:MIPS, Fuxin Zhang, Zhangjin Wu, Jiaxun Yang
OK, I will send V2 soon.
On Sat, May 2, 2020 at 6:20 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Sat, May 02, 2020 at 12:55:26PM +0800, Huacai Chen wrote:
> > 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__))
> > | ^~~~~~~~~~~~~
> > >> 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.
> >
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Huacai Chen <chenhc@lemote.com>
> > ---
> > arch/mips/kernel/perf_event_mipsxx.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
> > index a14974c..710b2c7 100644
> > --- a/arch/mips/kernel/perf_event_mipsxx.c
> > +++ b/arch/mips/kernel/perf_event_mipsxx.c
> > @@ -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;
> > }
> > }
>
> 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 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-02 10:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-02 4:55 [PATCH] MIPS: perf: Remove unnecessary "fallthrough" pseudo keywords Huacai Chen
2020-05-02 10:04 ` Thomas Bogendoerfer
2020-05-02 10:42 ` Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox