]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915/gvt/kvmgt: trival: code cleanup
authorJike Song <jike.song@intel.com>
Fri, 16 Dec 2016 02:51:07 +0000 (10:51 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 26 Dec 2016 01:45:29 +0000 (09:45 +0800)
Don't introduce local variables unless necessary.

Signed-off-by: Jike Song <jike.song@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/kvmgt.c

index efb01435f13f54dde0b588aca623b03c69a9c667..934963970288e28db522eecc8ab603d4b34472c0 100644 (file)
@@ -555,6 +555,7 @@ static void intel_vgpu_release_work(struct work_struct *work)
 {
        struct intel_vgpu *vgpu = container_of(work, struct intel_vgpu,
                                        vdev.release_work);
+
        __intel_vgpu_release(vgpu);
 }
 
@@ -1340,18 +1341,14 @@ static int kvmgt_guest_init(struct mdev_device *mdev)
 
 static bool kvmgt_guest_exit(struct kvmgt_guest_info *info)
 {
-       struct intel_vgpu *vgpu;
-
        if (!info) {
                gvt_err("kvmgt_guest_info invalid\n");
                return false;
        }
 
-       vgpu = info->vgpu;
-
        kvm_page_track_unregister_notifier(info->kvm, &info->track_node);
        kvmgt_protect_table_destroy(info);
-       gvt_cache_destroy(vgpu);
+       gvt_cache_destroy(info->vgpu);
        vfree(info);
 
        return true;