aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-24 17:56:53 +0200
committerAlex Williamson <alex.williamson@redhat.com>2021-09-30 12:46:43 -0600
commitc5b4ba9730e6d607d11c3c3c9b2f04852e121423 (patch)
tree88bb803ee19b020a64df016790e1d63f6041c5b6 /drivers/vfio
parentvfio: factor out a vfio_iommu_driver_allowed helper (diff)
downloadlinux-dev-c5b4ba9730e6d607d11c3c3c9b2f04852e121423.tar.xz
linux-dev-c5b4ba9730e6d607d11c3c3c9b2f04852e121423.zip
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20210924155705.4258-4-hch@lst.de Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/vfio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index faf8e0d637bb..8bd4b0b96b94 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -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,