* [PATCH] x86/events: Mark expected switch fall-throughs @ 2019-01-25 18:49 Gustavo A. R. Silva 2019-01-29 15:25 ` Borislav Petkov 2019-01-29 15:27 ` [tip:x86/cleanups] x86/events: Mark expected switch-case fall-throughs tip-bot for Gustavo A. R. Silva 0 siblings, 2 replies; 8+ messages in thread From: Gustavo A. R. Silva @ 2019-01-25 18:49 UTC (permalink / raw) To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin, x86 Cc: linux-kernel, Gustavo A. R. Silva, Kees Cook In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: In file included from arch/x86/events/intel/core.c:22: arch/x86/events/intel/core.c: In function ‘intel_pmu_init’: arch/x86/events/intel/../perf_event.h:668:17: warning: this statement may fall through [-Wimplicit-fallthrough=] x86_pmu.quirks = &__quirk; \ ~~~~~~~~~~~~~~~^~~~~~~~~~ arch/x86/events/intel/core.c:4170:3: note: in expansion of macro ‘x86_add_quirk’ x86_add_quirk(intel_clovertown_quirk); ^~~~~~~~~~~~~ arch/x86/events/intel/core.c:4171:2: note: here case INTEL_FAM6_CORE2_MEROM_L: ^~~~ arch/x86/events/intel/lbr.c:929:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> --- arch/x86/events/intel/core.c | 2 ++ arch/x86/events/intel/lbr.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 40e12cfc87f6..ece43e7e4569 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4168,6 +4168,8 @@ __init int intel_pmu_init(void) case INTEL_FAM6_CORE2_MEROM: x86_add_quirk(intel_clovertown_quirk); + /* fall through */ + case INTEL_FAM6_CORE2_MEROM_L: case INTEL_FAM6_CORE2_PENRYN: case INTEL_FAM6_CORE2_DUNNINGTON: diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index c88ed39582a1..580c1b91c454 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -931,6 +931,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort) ret = X86_BR_ZERO_CALL; break; } + /* fall through */ case 0x9a: /* call far absolute */ ret = X86_BR_CALL; break; -- 2.20.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-25 18:49 [PATCH] x86/events: Mark expected switch fall-throughs Gustavo A. R. Silva @ 2019-01-29 15:25 ` Borislav Petkov 2019-01-29 15:58 ` Gustavo A. R. Silva 2019-01-29 15:27 ` [tip:x86/cleanups] x86/events: Mark expected switch-case fall-throughs tip-bot for Gustavo A. R. Silva 1 sibling, 1 reply; 8+ messages in thread From: Borislav Petkov @ 2019-01-29 15:25 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On Fri, Jan 25, 2019 at 12:49:17PM -0600, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warnings: > > In file included from arch/x86/events/intel/core.c:22: > arch/x86/events/intel/core.c: In function ‘intel_pmu_init’: > arch/x86/events/intel/../perf_event.h:668:17: warning: this statement may fall through [-Wimplicit-fallthrough=] > x86_pmu.quirks = &__quirk; \ > ~~~~~~~~~~~~~~~^~~~~~~~~~ > arch/x86/events/intel/core.c:4170:3: note: in expansion of macro ‘x86_add_quirk’ > x86_add_quirk(intel_clovertown_quirk); > ^~~~~~~~~~~~~ > arch/x86/events/intel/core.c:4171:2: note: here > case INTEL_FAM6_CORE2_MEROM_L: > ^~~~ > arch/x86/events/intel/lbr.c:929:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > > Warning level 3 was used: -Wimplicit-fallthrough=3 > > This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. > > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> > --- > arch/x86/events/intel/core.c | 2 ++ > arch/x86/events/intel/lbr.c | 1 + > 2 files changed, 3 insertions(+) You do know how to use scripts/get_maintainer.pl, right? Because I don't see PeterZ on CC. Please use that script when preparing patches. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-29 15:25 ` Borislav Petkov @ 2019-01-29 15:58 ` Gustavo A. R. Silva 2019-01-29 16:07 ` Borislav Petkov 0 siblings, 1 reply; 8+ messages in thread From: Gustavo A. R. Silva @ 2019-01-29 15:58 UTC (permalink / raw) To: Borislav Petkov Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On 1/29/19 9:25 AM, Borislav Petkov wrote: > On Fri, Jan 25, 2019 at 12:49:17PM -0600, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. >> >> This patch fixes the following warnings: >> >> In file included from arch/x86/events/intel/core.c:22: >> arch/x86/events/intel/core.c: In function ‘intel_pmu_init’: >> arch/x86/events/intel/../perf_event.h:668:17: warning: this statement may fall through [-Wimplicit-fallthrough=] >> x86_pmu.quirks = &__quirk; \ >> ~~~~~~~~~~~~~~~^~~~~~~~~~ >> arch/x86/events/intel/core.c:4170:3: note: in expansion of macro ‘x86_add_quirk’ >> x86_add_quirk(intel_clovertown_quirk); >> ^~~~~~~~~~~~~ >> arch/x86/events/intel/core.c:4171:2: note: here >> case INTEL_FAM6_CORE2_MEROM_L: >> ^~~~ >> arch/x86/events/intel/lbr.c:929:6: warning: this statement may fall through [-Wimplicit-fallthrough=] >> >> Warning level 3 was used: -Wimplicit-fallthrough=3 >> >> This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. >> >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> >> --- >> arch/x86/events/intel/core.c | 2 ++ >> arch/x86/events/intel/lbr.c | 1 + >> 2 files changed, 3 insertions(+) > > You do know how to use scripts/get_maintainer.pl, right? > > Because I don't see PeterZ on CC. > > Please use that script when preparing patches. > $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback arch/x86/events/intel/core.c Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Borislav Petkov <bp@alien8.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) "H. Peter Anvin" <hpa@zytor.com> (reviewer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback arch/x86/events/intel/lbr.c Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Borislav Petkov <bp@alien8.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) "H. Peter Anvin" <hpa@zytor.com> (reviewer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Does the MAINTAINERS file need an update? -- Gustavo ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-29 15:58 ` Gustavo A. R. Silva @ 2019-01-29 16:07 ` Borislav Petkov 2019-01-29 16:19 ` Gustavo A. R. Silva 0 siblings, 1 reply; 8+ messages in thread From: Borislav Petkov @ 2019-01-29 16:07 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On Tue, Jan 29, 2019 at 09:58:05AM -0600, Gustavo A. R. Silva wrote: > $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback arch/x86/events/intel/core.c You need to have -f when supplying a file: scripts/get_maintainer.pl -f arch/x86/events/intel/core.c and the pattern is there: PERFORMANCE EVENTS SUBSYSTEM M: Peter Zijlstra <peterz@infradead.org> ... F: arch/*/events/* yet it still doesn't list Peter as maintainer: Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),commit_signer:21/22=95%) Borislav Petkov <bp@alien8.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) "H. Peter Anvin" <hpa@zytor.com> (reviewer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Peter Zijlstra <peterz@infradead.org> (commit_signer:19/22=86%,authored:3/22=14%,added_lines:22/382=6%,removed_lines:13/122=11%) Kan Liang <kan.liang@linux.intel.com> (commit_signer:11/22=50%,authored:10/22=45%,added_lines:144/382=38%,removed_lines:73/122=60%) Jiri Olsa <jolsa@kernel.org> (commit_signer:4/22=18%,authored:4/22=18%,added_lines:99/382=26%,removed_lines:32/122=26%) Andi Kleen <ak@linux.intel.com> (added_lines:113/382=30%) linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT) if you change the pattern to F: arch/*/events/ i.e., drop the '*', then it works: $ scripts/get_maintainer.pl -f arch/x86/events/intel/core.c Peter Zijlstra <peterz@infradead.org> (supporter:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:19/22=86%,authored:3/22=14%,added_lines:22/382=6%,removed_lines:13/122=11%) Ingo Molnar <mingo@redhat.com> (supporter:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:21/22=95%) Arnaldo Carvalho de Melo <acme@kernel.org> (supporter:PERFORMANCE EVENTS SUBSYSTEM) Alexander Shishkin <alexander.shishkin@linux.intel.com> (reviewer:PERFORMANCE EVENTS SUBSYSTEM) Jiri Olsa <jolsa@redhat.com> (reviewer:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:4/22=18%,authored:4/22=18%,added_lines:99/382=26%,removed_lines:32/122=26%) Namhyung Kim <namhyung@kernel.org> (reviewer:PERFORMANCE EVENTS SUBSYSTEM) ... -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-29 16:07 ` Borislav Petkov @ 2019-01-29 16:19 ` Gustavo A. R. Silva 2019-01-29 17:04 ` Borislav Petkov 0 siblings, 1 reply; 8+ messages in thread From: Gustavo A. R. Silva @ 2019-01-29 16:19 UTC (permalink / raw) To: Borislav Petkov Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On 1/29/19 10:07 AM, Borislav Petkov wrote: > On Tue, Jan 29, 2019 at 09:58:05AM -0600, Gustavo A. R. Silva wrote: >> $ scripts/get_maintainer.pl --nokeywords --nogit --nogit-fallback arch/x86/events/intel/core.c > > You need to have -f when supplying a file: > > scripts/get_maintainer.pl -f arch/x86/events/intel/core.c > You're correct. I used the command I use for patches. > and the pattern is there: > > PERFORMANCE EVENTS SUBSYSTEM > M: Peter Zijlstra <peterz@infradead.org> > ... > F: arch/*/events/* > > yet it still doesn't list Peter as maintainer: > Yep. And this is the reason why I didn't include him. > Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) > Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),commit_signer:21/22=95%) > Borislav Petkov <bp@alien8.de> (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) > "H. Peter Anvin" <hpa@zytor.com> (reviewer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) > x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) > Peter Zijlstra <peterz@infradead.org> (commit_signer:19/22=86%,authored:3/22=14%,added_lines:22/382=6%,removed_lines:13/122=11%) > Kan Liang <kan.liang@linux.intel.com> (commit_signer:11/22=50%,authored:10/22=45%,added_lines:144/382=38%,removed_lines:73/122=60%) > Jiri Olsa <jolsa@kernel.org> (commit_signer:4/22=18%,authored:4/22=18%,added_lines:99/382=26%,removed_lines:32/122=26%) > Andi Kleen <ak@linux.intel.com> (added_lines:113/382=30%) > linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT) > > if you change the pattern to > > F: arch/*/events/ > > i.e., drop the '*', then it works: > > $ scripts/get_maintainer.pl -f arch/x86/events/intel/core.c Yeah. But I don't want to send patches to every person that has touched the file. > Peter Zijlstra <peterz@infradead.org> (supporter:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:19/22=86%,authored:3/22=14%,added_lines:22/382=6%,removed_lines:13/122=11%) > Ingo Molnar <mingo@redhat.com> (supporter:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:21/22=95%) > Arnaldo Carvalho de Melo <acme@kernel.org> (supporter:PERFORMANCE EVENTS SUBSYSTEM) > Alexander Shishkin <alexander.shishkin@linux.intel.com> (reviewer:PERFORMANCE EVENTS SUBSYSTEM) > Jiri Olsa <jolsa@redhat.com> (reviewer:PERFORMANCE EVENTS SUBSYSTEM,commit_signer:4/22=18%,authored:4/22=18%,added_lines:99/382=26%,removed_lines:32/122=26%) > Namhyung Kim <namhyung@kernel.org> (reviewer:PERFORMANCE EVENTS SUBSYSTEM) > ... > -- Gustavo ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-29 16:19 ` Gustavo A. R. Silva @ 2019-01-29 17:04 ` Borislav Petkov 2019-01-29 17:09 ` Gustavo A. R. Silva 0 siblings, 1 reply; 8+ messages in thread From: Borislav Petkov @ 2019-01-29 17:04 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On Tue, Jan 29, 2019 at 10:19:59AM -0600, Gustavo A. R. Silva wrote: > Yeah. But I don't want to send patches to every person that has touched the file. Yes but you should *definitely* CC supporters and reviewers. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/events: Mark expected switch fall-throughs 2019-01-29 17:04 ` Borislav Petkov @ 2019-01-29 17:09 ` Gustavo A. R. Silva 0 siblings, 0 replies; 8+ messages in thread From: Gustavo A. R. Silva @ 2019-01-29 17:09 UTC (permalink / raw) To: Borislav Petkov Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel, Kees Cook, Peter Zijlstra On 1/29/19 11:04 AM, Borislav Petkov wrote: > On Tue, Jan 29, 2019 at 10:19:59AM -0600, Gustavo A. R. Silva wrote: >> Yeah. But I don't want to send patches to every person that has touched the file. > > Yes but you should *definitely* CC supporters and reviewers. > Okay. I'll take note of that. Thanks for the feedback. -- Gustavo ^ permalink raw reply [flat|nested] 8+ messages in thread
* [tip:x86/cleanups] x86/events: Mark expected switch-case fall-throughs 2019-01-25 18:49 [PATCH] x86/events: Mark expected switch fall-throughs Gustavo A. R. Silva 2019-01-29 15:25 ` Borislav Petkov @ 2019-01-29 15:27 ` tip-bot for Gustavo A. R. Silva 1 sibling, 0 replies; 8+ messages in thread From: tip-bot for Gustavo A. R. Silva @ 2019-01-29 15:27 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, tglx, mingo, peterz, keescook, hpa, x86, gustavo, qianyue.zj, jacek.tomaka, jolsa, ak, mingo, bp, kan.liang Commit-ID: 2b0fc3742bc77687f58d389c902ee092df6f8669 Gitweb: https://git.kernel.org/tip/2b0fc3742bc77687f58d389c902ee092df6f8669 Author: Gustavo A. R. Silva <gustavo@embeddedor.com> AuthorDate: Fri, 25 Jan 2019 12:49:17 -0600 Committer: Borislav Petkov <bp@suse.de> CommitDate: Tue, 29 Jan 2019 16:23:47 +0100 x86/events: Mark expected switch-case fall-throughs In preparation to enable -Wimplicit-fallthrough by default, mark switch-case statements where fall-through is intentional, explicitly in order to fix a couple of -Wimplicit-fallthrough warnings. Warning level 3 was used: -Wimplicit-fallthrough=3. [ bp: Massasge and trim commit message. ] Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jacek Tomaka <jacek.tomaka@poczta.fm> Cc: Jia Zhang <qianyue.zj@alibaba-inc.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kees Cook <keescook@chromium.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20190125184917.GA7289@embeddedor --- arch/x86/events/intel/core.c | 2 ++ arch/x86/events/intel/lbr.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 40e12cfc87f6..ece43e7e4569 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4168,6 +4168,8 @@ __init int intel_pmu_init(void) case INTEL_FAM6_CORE2_MEROM: x86_add_quirk(intel_clovertown_quirk); + /* fall through */ + case INTEL_FAM6_CORE2_MEROM_L: case INTEL_FAM6_CORE2_PENRYN: case INTEL_FAM6_CORE2_DUNNINGTON: diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index c88ed39582a1..580c1b91c454 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -931,6 +931,7 @@ static int branch_type(unsigned long from, unsigned long to, int abort) ret = X86_BR_ZERO_CALL; break; } + /* fall through */ case 0x9a: /* call far absolute */ ret = X86_BR_CALL; break; ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-01-29 17:09 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-01-25 18:49 [PATCH] x86/events: Mark expected switch fall-throughs Gustavo A. R. Silva 2019-01-29 15:25 ` Borislav Petkov 2019-01-29 15:58 ` Gustavo A. R. Silva 2019-01-29 16:07 ` Borislav Petkov 2019-01-29 16:19 ` Gustavo A. R. Silva 2019-01-29 17:04 ` Borislav Petkov 2019-01-29 17:09 ` Gustavo A. R. Silva 2019-01-29 15:27 ` [tip:x86/cleanups] x86/events: Mark expected switch-case fall-throughs tip-bot for Gustavo A. R. Silva
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.