Skip to content

Commit 9d4c304

Browse files
committed
KVM: x86: don't fall through case statements without annotations
clang warns on this because it has an unannotated fall-through between cases: arch/x86/kvm/x86.c:4819:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] and while we could annotate it as a fallthrough, the proper fix is to just add the break for this case, instead of falling through to the default case and the break there. gcc also has that warning, but it looks like gcc only warns for the cases where they fall through to "real code", rather than to just a break. Odd. Fixes: d30d9ee ("KVM: x86: Only advertise KVM_CAP_READONLY_MEM when supported by VM") Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Tom Dohrmann <erbse.13@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6b8ff51 commit 9d4c304

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/x86/kvm/x86.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4816,6 +4816,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
48164816
break;
48174817
case KVM_CAP_READONLY_MEM:
48184818
r = kvm ? kvm_arch_has_readonly_mem(kvm) : 1;
4819+
break;
48194820
default:
48204821
break;
48214822
}

0 commit comments

Comments
 (0)