diff mbox series

[2/2] i386: Fix coding style in kvm_hyperv_expand_features()

Message ID 20210716115852.418293-2-vkuznets@redhat.com
State New
Headers show
Series [1/2] i386: assert 'cs->kvm_state' is not null | expand

Commit Message

Vitaly Kuznetsov July 16, 2021, 11:58 a.m. UTC
QEMU coding style requires braces around bodies of ifs.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 target/i386/kvm/kvm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini July 29, 2021, 7:50 a.m. UTC | #1
On 16/07/21 13:58, Vitaly Kuznetsov wrote:
> QEMU coding style requires braces around bodies of ifs.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>   target/i386/kvm/kvm.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index e69abe48e3f8..28ca682b1089 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -1219,8 +1219,9 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
>       Error *local_err = NULL;
>       int feat;
>   
> -    if (!hyperv_enabled(cpu))
> +    if (!hyperv_enabled(cpu)) {
>           return true;
> +    }
>   
>       /*
>        * When kvm_hyperv_expand_features is called at CPU feature expansion
> @@ -1228,8 +1229,9 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
>        * when KVM_CAP_SYS_HYPERV_CPUID is supported.
>        */
>       if (!cs->kvm_state &&
> -        !kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID))
> +        !kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID)) {
>           return true;
> +    }
>   
>       if (cpu->hyperv_passthrough) {
>           cpu->hyperv_vendor_id[0] =
> 

Queued both, thanks.

Paolo
diff mbox series

Patch

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index e69abe48e3f8..28ca682b1089 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1219,8 +1219,9 @@  bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
     Error *local_err = NULL;
     int feat;
 
-    if (!hyperv_enabled(cpu))
+    if (!hyperv_enabled(cpu)) {
         return true;
+    }
 
     /*
      * When kvm_hyperv_expand_features is called at CPU feature expansion
@@ -1228,8 +1229,9 @@  bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
      * when KVM_CAP_SYS_HYPERV_CPUID is supported.
      */
     if (!cs->kvm_state &&
-        !kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID))
+        !kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID)) {
         return true;
+    }
 
     if (cpu->hyperv_passthrough) {
         cpu->hyperv_vendor_id[0] =