summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorLi kunyu <kunyu@nfschina.com>2022-08-19 04:15:35 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-08-19 10:05:43 +0200
commiteceb6e1d530046f964b0e371d4fad02a5b6b42d1 (patch)
tree19f8c00a90a03ee263c2bab281f7d1b00fcc0951 /virt
parentKVM: Drop unnecessary initialization of "npages" in hva_to_pfn_slow() (diff)
downloadlinux-eceb6e1d530046f964b0e371d4fad02a5b6b42d1.tar.xz
linux-eceb6e1d530046f964b0e371d4fad02a5b6b42d1.zip
KVM: Drop unnecessary initialization of "ops" in kvm_ioctl_create_device()
The variable is initialized but it is only used after its assignment. Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Li kunyu <kunyu@nfschina.com> Message-Id: <20220819021535.483702-1-kunyu@nfschina.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c916c4c8801c..584a5bab3af3 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4380,7 +4380,7 @@ void kvm_unregister_device_ops(u32 type)
static int kvm_ioctl_create_device(struct kvm *kvm,
struct kvm_create_device *cd)
{
- const struct kvm_device_ops *ops = NULL;
+ const struct kvm_device_ops *ops;
struct kvm_device *dev;
bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
int type;