Commit c5b4ba97 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Williamson

vfio: remove the iommudata check in vfio_noiommu_attach_group

vfio_noiommu_attach_group has two callers:

 1) __vfio_container_attach_groups is called by vfio_ioctl_set_iommu,
    which just called vfio_iommu_driver_allowed
 2) vfio_group_set_container requires already checks ->noiommu on the
    vfio_group, which is propagated from the iommudata in
    vfio_create_group

so this check is entirely superflous and can be removed.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20210924155705.4258-4-hch@lst.deSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent b0062160
......@@ -240,7 +240,7 @@ static long vfio_noiommu_ioctl(void *iommu_data,
static int vfio_noiommu_attach_group(void *iommu_data,
struct iommu_group *iommu_group)
{
return iommu_group_get_iommudata(iommu_group) == &noiommu ? 0 : -EINVAL;
return 0;
}
static void vfio_noiommu_detach_group(void *iommu_data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment