* [PATCH] MIPS: Annotate fall-through in kvm/emulate.c
@ 2019-07-17 19:49 Paul Burton
2019-07-18 20:52 ` Paul Burton
0 siblings, 1 reply; 2+ messages in thread
From: Paul Burton @ 2019-07-17 19:49 UTC (permalink / raw)
To: linux-mips; +Cc: Paul Burton
kvm_compute_return_epc contains a switch statement with an intentional
fall-through from a case handling jal (jump and link) instructions to
one handling j (jump) instructions. With -Wimplicit-fallthrough this
triggers a compile error (due to -Werror being enabled for arch/mips).
This can be reproduced using malta_kvm_defconfig.
Fix this by annotating the intentional fall-through.
Signed-off-by: Paul Burton <paul.burton@mips.com>
---
arch/mips/kvm/emulate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index e5de6bac8197..754094b40a75 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -140,6 +140,7 @@ static int kvm_compute_return_epc(struct kvm_vcpu *vcpu, unsigned long instpc,
/* These are unconditional and in j_format. */
case jal_op:
arch->gprs[31] = instpc + 8;
+ /* fall through */
case j_op:
epc += 4;
epc >>= 28;
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: Annotate fall-through in kvm/emulate.c
2019-07-17 19:49 [PATCH] MIPS: Annotate fall-through in kvm/emulate.c Paul Burton
@ 2019-07-18 20:52 ` Paul Burton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-07-18 20:52 UTC (permalink / raw)
To: Paul Burton; +Cc: linux-mips, Paul Burton, linux-mips
Hello,
Paul Burton wrote:
> kvm_compute_return_epc contains a switch statement with an intentional
> fall-through from a case handling jal (jump and link) instructions to
> one handling j (jump) instructions. With -Wimplicit-fallthrough this
> triggers a compile error (due to -Werror being enabled for arch/mips).
>
> This can be reproduced using malta_kvm_defconfig.
>
> Fix this by annotating the intentional fall-through.
>
> Signed-off-by: Paul Burton <paul.burton@mips.com>
Applied to mips-fixes.
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@mips.com to report it. ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-18 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 19:49 [PATCH] MIPS: Annotate fall-through in kvm/emulate.c Paul Burton
2019-07-18 20:52 ` Paul Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).