[PATCH] target/i386/kvm: Add missing fallthrough comment

Thomas Huth posted 1 patch 3 years, 7 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200911125301.413081-1-thuth@redhat.com
Maintainers: Richard Henderson <rth@twiddle.net>, Marcelo Tosatti <mtosatti@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] target/i386/kvm: Add missing fallthrough comment
Posted by Thomas Huth 3 years, 7 months ago
Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here,
so we should add the corresponding "/* fallthrough */" comment here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/i386/kvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 205b68bc0c..283d3305d5 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1568,6 +1568,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
             if (env->nr_dies < 2) {
                 break;
             }
+            /* fallthrough */
         case 4:
         case 0xb:
         case 0xd:
-- 
2.18.2


Re: [PATCH] target/i386/kvm: Add missing fallthrough comment
Posted by Paolo Bonzini 3 years, 7 months ago
On 11/09/20 14:53, Thomas Huth wrote:
> Let's make this file compilable with -Werror=implicit-fallthrough :
> Looking at the code, it seems like the fallthrough is intended here,
> so we should add the corresponding "/* fallthrough */" comment here.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  target/i386/kvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 205b68bc0c..283d3305d5 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1568,6 +1568,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
>              if (env->nr_dies < 2) {
>                  break;
>              }
> +            /* fallthrough */
>          case 4:
>          case 0xb:
>          case 0xd:
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>


Re: [PATCH] target/i386/kvm: Add missing fallthrough comment
Posted by no-reply@patchew.org 3 years, 7 months ago
Patchew URL: https://patchew.org/QEMU/20200911125301.413081-1-thuth@redhat.com/



Hi,

This series failed build test on FreeBSD host. Please find the details below.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
if qemu-system-x86_64 --help >/dev/null 2>&1; then
  QEMU=qemu-system-x86_64
elif /usr/libexec/qemu-kvm --help >/dev/null 2>&1; then
  QEMU=/usr/libexec/qemu-kvm
else
  exit 1
fi
make vm-build-freebsd J=21 QEMU=$QEMU
exit 0
=== TEST SCRIPT END ===




The full log is available at
http://patchew.org/logs/20200911125301.413081-1-thuth@redhat.com/testing.FreeBSD/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH] target/i386/kvm: Add missing fallthrough comment
Posted by Laurent Vivier 3 years, 7 months ago
Le 11/09/2020 à 14:53, Thomas Huth a écrit :
> Let's make this file compilable with -Werror=implicit-fallthrough :
> Looking at the code, it seems like the fallthrough is intended here,
> so we should add the corresponding "/* fallthrough */" comment here.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  target/i386/kvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 205b68bc0c..283d3305d5 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1568,6 +1568,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
>              if (env->nr_dies < 2) {
>                  break;
>              }
> +            /* fallthrough */
>          case 4:
>          case 0xb:
>          case 0xd:
> 


Applied to my trivial-patches branch.

Thanks,
Laurent