From: "tip-bot for Gustavo A. R. Silva" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: x86@kernel.org, bp@suse.de, tglx@linutronix.de,
gustavo@embeddedor.com, linux-kernel@vger.kernel.org,
mingo@kernel.org, hpa@zytor.com, mingo@redhat.com,
keescook@chromium.org
Subject: [tip:x86/cleanups] x86/insn-eval: Mark expected switch-case fall-through
Date: Sat, 26 Jan 2019 02:15:56 -0800 [thread overview]
Message-ID: <tip-89da3446294a8b811b28a4807e74e7ee7044d49f@git.kernel.org> (raw)
In-Reply-To: <20190125205520.GA9602@embeddedor>
Commit-ID: 89da3446294a8b811b28a4807e74e7ee7044d49f
Gitweb: https://git.kernel.org/tip/89da3446294a8b811b28a4807e74e7ee7044d49f
Author: Gustavo A. R. Silva <gustavo@embeddedor.com>
AuthorDate: Fri, 25 Jan 2019 14:55:20 -0600
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Sat, 26 Jan 2019 10:46:42 +0100
x86/insn-eval: Mark expected switch-case fall-through
In preparation to enable -Wimplicit-fallthrough by default, mark
switch-case statements where fall-through is intentional, explicitly.
Thus fix the following warning:
arch/x86/lib/insn-eval.c: In function ‘resolve_default_seg’:
arch/x86/lib/insn-eval.c:179:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (insn->addr_bytes == 2)
^
arch/x86/lib/insn-eval.c:182:2: note: here
case -EDOM:
^~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This is part of the ongoing efforts to enable -Wimplicit-fallthrough by
default.
[ bp: Massage commit message. ]
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.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/20190125205520.GA9602@embeddedor
---
arch/x86/lib/insn-eval.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/lib/insn-eval.c b/arch/x86/lib/insn-eval.c
index 9119d8e41f1f..cf00ab6c6621 100644
--- a/arch/x86/lib/insn-eval.c
+++ b/arch/x86/lib/insn-eval.c
@@ -179,6 +179,8 @@ static int resolve_default_seg(struct insn *insn, struct pt_regs *regs, int off)
if (insn->addr_bytes == 2)
return -EINVAL;
+ /* fall through */
+
case -EDOM:
case offsetof(struct pt_regs, bx):
case offsetof(struct pt_regs, si):
prev parent reply other threads:[~2019-01-26 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 20:55 [PATCH] x86/insn-eval: Mark expected switch fall-through Gustavo A. R. Silva
2019-01-26 9:47 ` Borislav Petkov
2019-01-26 14:05 ` Gustavo A. R. Silva
2019-01-26 10:15 ` tip-bot for Gustavo A. R. Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-89da3446294a8b811b28a4807e74e7ee7044d49f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=gustavo@embeddedor.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome