KVM: x86: Use mutex guards to eliminate __kvm_x86_vendor_init()
authorNikolay Borisov <nik.borisov@suse.com>
Mon, 30 Oct 2023 14:17:28 +0000 (16:17 +0200)
committerSean Christopherson <seanjc@google.com>
Mon, 29 Jan 2024 16:37:47 +0000 (08:37 -0800)
commit955997e880175b00161efb83b1b282849ff412d3
treeba35b5e4f09c69268ab0743f124f2e981f1c239d
parent41bccc98fb7931d63d03f326a746ac4d429c1dd3
KVM: x86: Use mutex guards to eliminate __kvm_x86_vendor_init()

Use the recently introduced guard(mutex) infrastructure acquire and
automatically release vendor_module_lock when the guard goes out of scope.
Drop the inner __kvm_x86_vendor_init(), its sole purpose was to simplify
releasing vendor_module_lock in error paths.

No functional change intended.

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20231030141728.1406118-1-nik.borisov@suse.com
[sean: rewrite changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c