[Intel-gfx] [PATCH v1 4/5] Samples/mdev: Uses the vfio emulated iommufd ops set in the mdev sample drivers

Tian, Kevin kevin.tian at intel.com
Fri Mar 10 02:10:33 UTC 2023


> From: Liu, Yi L <yi.l.liu at intel.com>
> Sent: Wednesday, March 8, 2023 9:14 PM
> 
> @@ -32,12 +32,8 @@ int vfio_iommufd_bind(struct vfio_device *vdev,
> struct iommufd_ctx *ictx)
>  		return 0;
>  	}
> 
> -	/*
> -	 * If the driver doesn't provide this op then it means the device does
> -	 * not do DMA at all. So nothing to do.
> -	 */
> -	if (!vdev->ops->bind_iommufd)
> -		return 0;
> +	if (WARN_ON(!vdev->ops->bind_iommufd))
> +		return -ENODEV;
> 

this is not required given next patch adds the WARN_ON() at device
registration.

let's just remove the check (together in next patch).


More information about the Intel-gfx mailing list