2019-07-29 09:01:12

by Paul Menzel

[permalink] [raw]
Subject: arch/powerpc/kvm/book3s_32_mmu.c:241:21: error: this statement may fall through [-Werror=implicit-fallthrough=]

Dear Linux folks,


Building Linux 5.3-rc2 with the attached configuration on ppc64le fails with
the error below. Linux 5.3-rc1 built fine, so this looks like a regression.

```
arch/powerpc/kvm/book3s_32_mmu.c: In function ‘kvmppc_mmu_book3s_32_xlate_pte’:
arch/powerpc/kvm/book3s_32_mmu.c:241:21: error: this statement may fall through [-Werror=implicit-fallthrough=]
pte->may_write = true;
~~~~~~~~~~~~~~~^~~~~~
arch/powerpc/kvm/book3s_32_mmu.c:242:5: note: here
case 3:
^~~~
```


Kind regards,

Paul


Attachments:
linux-5.3-rc2.config (210.40 kB)
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature
Download all attachments

2019-07-30 16:36:10

by Paul Menzel

[permalink] [raw]
Subject: [PATCH] powerpc/kvm: Mark expected switch fall-through

Date: Tue, 30 Jul 2019 10:53:10 +0200

Fix the error below triggered by `-Wimplicit-fallthrough`, by tagging
it as an expected fall-through.

arch/powerpc/kvm/book3s_32_mmu.c: In function ‘kvmppc_mmu_book3s_32_xlate_pte’:
arch/powerpc/kvm/book3s_32_mmu.c:241:21: error: this statement may fall through [-Werror=implicit-fallthrough=]
pte->may_write = true;
~~~~~~~~~~~~~~~^~~~~~
arch/powerpc/kvm/book3s_32_mmu.c:242:5: note: here
case 3:
^~~~

---
arch/powerpc/kvm/book3s_32_mmu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
index 653936177857..18f244aad7aa 100644
--- a/arch/powerpc/kvm/book3s_32_mmu.c
+++ b/arch/powerpc/kvm/book3s_32_mmu.c
@@ -239,6 +239,7 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
case 2:
case 6:
pte->may_write = true;
+ /* fall through */
case 3:
case 5:
case 7:
--
2.20.1


Attachments:
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature

2019-08-23 22:54:37

by Paul Mackerras

[permalink] [raw]
Subject: Re: [PATCH] powerpc/kvm: Mark expected switch fall-through

On Tue, Jul 30, 2019 at 04:46:37PM +0200, Paul Menzel wrote:
> Date: Tue, 30 Jul 2019 10:53:10 +0200
>
> Fix the error below triggered by `-Wimplicit-fallthrough`, by tagging
> it as an expected fall-through.
>
> arch/powerpc/kvm/book3s_32_mmu.c: In function ‘kvmppc_mmu_book3s_32_xlate_pte’:
> arch/powerpc/kvm/book3s_32_mmu.c:241:21: error: this statement may fall through [-Werror=implicit-fallthrough=]
> pte->may_write = true;
> ~~~~~~~~~~~~~~~^~~~~~
> arch/powerpc/kvm/book3s_32_mmu.c:242:5: note: here
> case 3:
> ^~~~
>

Thanks, applied to my kvm-ppc-next branch.

Paul.