]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
LoongArch: KVM: Remove unnecessary local variable
authorBibo Mao <maobibo@loongson.cn>
Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)
Local variable device1 can be replaced with existing variable device,
it makes code concise.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kvm/intc/eiointc.c

index a75f865d6fb96c4e32c94444b33085dec3bbd787..75caf176d4a99ae26974ba2b4e3611e638d7dc5e 100644 (file)
@@ -989,7 +989,7 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type)
 {
        int ret;
        struct loongarch_eiointc *s;
-       struct kvm_io_device *device, *device1;
+       struct kvm_io_device *device;
        struct kvm *kvm = dev->kvm;
 
        /* eiointc has been created */
@@ -1017,10 +1017,10 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type)
                return ret;
        }
 
-       device1 = &s->device_vext;
-       kvm_iodevice_init(device1, &kvm_eiointc_virt_ops);
+       device = &s->device_vext;
+       kvm_iodevice_init(device, &kvm_eiointc_virt_ops);
        ret = kvm_io_bus_register_dev(kvm, KVM_IOCSR_BUS,
-                       EIOINTC_VIRT_BASE, EIOINTC_VIRT_SIZE, device1);
+                       EIOINTC_VIRT_BASE, EIOINTC_VIRT_SIZE, device);
        if (ret < 0) {
                kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &s->device);
                kfree(s);