diff mbox series

MIPS: Annotate fall-through in kvm/emulate.c

Message ID 20190717194900.30143-1-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit 5bbe54346b539b5938b65d542b6ff5e956c3c08d
Headers show
Series MIPS: Annotate fall-through in kvm/emulate.c | expand

Commit Message

Paul Burton July 17, 2019, 7:49 p.m. UTC
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(+)

Comments

Paul Burton July 18, 2019, 8:52 p.m. UTC | #1
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. ]
diff mbox series

Patch

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;