vfio: no need to pass kvm pointer during device open
authorMatthew Rosato <mjrosato@linux.ibm.com>
Fri, 3 Feb 2023 21:50:27 +0000 (16:50 -0500)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 9 Feb 2023 18:41:25 +0000 (11:41 -0700)
Nothing uses this value during vfio_device_open anymore so it's safe
to remove it.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230203215027.151988-3-mjrosato@linux.ibm.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/group.c
drivers/vfio/vfio.h
drivers/vfio/vfio_main.c

index 98621ac082f03a9fb303dceed3dc34fd54aef6e8..0e9036e2b9c4005ee1236040d9e3a725a0e65c71 100644 (file)
@@ -187,7 +187,7 @@ static int vfio_device_group_open(struct vfio_device *device)
        if (device->open_count == 0)
                vfio_device_group_get_kvm_safe(device);
 
-       ret = vfio_device_open(device, device->group->iommufd, device->kvm);
+       ret = vfio_device_open(device, device->group->iommufd);
 
        if (device->open_count == 0)
                vfio_device_put_kvm(device);
index 8ec3a5db23f5f856d5a93b5a5df981ae949e8333..e9721d8424bc433f011e24dff75fa84bd8e87fd2 100644 (file)
@@ -18,8 +18,7 @@ struct vfio_container;
 
 void vfio_device_put_registration(struct vfio_device *device);
 bool vfio_device_try_get_registration(struct vfio_device *device);
-int vfio_device_open(struct vfio_device *device,
-                    struct iommufd_ctx *iommufd, struct kvm *kvm);
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd);
 void vfio_device_close(struct vfio_device *device,
                       struct iommufd_ctx *iommufd);
 
index 28c47cd6a6b5d8d5d0266ff0f85d33b5f3b89e91..3a597e799918733464445145b4f7f8f96dc0c671 100644 (file)
@@ -397,7 +397,7 @@ static bool vfio_assert_device_open(struct vfio_device *device)
 }
 
 static int vfio_device_first_open(struct vfio_device *device,
-                                 struct iommufd_ctx *iommufd, struct kvm *kvm)
+                                 struct iommufd_ctx *iommufd)
 {
        int ret;
 
@@ -444,8 +444,7 @@ static void vfio_device_last_close(struct vfio_device *device,
        module_put(device->dev->driver->owner);
 }
 
-int vfio_device_open(struct vfio_device *device,
-                    struct iommufd_ctx *iommufd, struct kvm *kvm)
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd)
 {
        int ret = 0;
 
@@ -453,7 +452,7 @@ int vfio_device_open(struct vfio_device *device,
 
        device->open_count++;
        if (device->open_count == 1) {
-               ret = vfio_device_first_open(device, iommufd, kvm);
+               ret = vfio_device_first_open(device, iommufd);
                if (ret)
                        device->open_count--;
        }