KVM: x86: Code style cleanup in kvm_arch_dev_ioctl()
authorXiaoyao Li <xiaoyao.li@intel.com>
Sat, 29 Feb 2020 02:52:12 +0000 (10:52 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 18 Mar 2020 13:05:45 +0000 (14:05 +0100)
In kvm_arch_dev_ioctl(), the brackets of case KVM_X86_GET_MCE_CAP_SUPPORTED
accidently encapsulates case KVM_GET_MSR_FEATURE_INDEX_LIST and case
KVM_GET_MSRS. It doesn't affect functionality but it's misleading.

Remove unnecessary brackets and opportunistically add a "break" in the
default path.

Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index e54c6ad628a810a047e1754f8196f2ec5e11ec42..a4e62d767dd6da09ee86e787818e458f7fd94224 100644 (file)
@@ -3488,7 +3488,7 @@ long kvm_arch_dev_ioctl(struct file *filp,
                r = 0;
                break;
        }
-       case KVM_X86_GET_MCE_CAP_SUPPORTED: {
+       case KVM_X86_GET_MCE_CAP_SUPPORTED:
                r = -EFAULT;
                if (copy_to_user(argp, &kvm_mce_cap_supported,
                                 sizeof(kvm_mce_cap_supported)))
@@ -3520,9 +3520,9 @@ long kvm_arch_dev_ioctl(struct file *filp,
        case KVM_GET_MSRS:
                r = msr_io(NULL, argp, do_get_msr_feature, 1);
                break;
-       }
        default:
                r = -EINVAL;
+               break;
        }
 out:
        return r;