summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2022-10-07 12:03:00 -0600
committerAlex Williamson <alex.williamson@redhat.com>2022-10-07 13:06:52 -0600
commitb1b8132a651cf6a5b18a01d8f1bd304f5d210315 (patch)
tree6b65d806c86a3c832a3a393e142004487453cab1
parent3dd59a7dcb97e6e40d6385a1a3faa9392b6d184a (diff)
downloadlinux-stable-b1b8132a651cf6a5b18a01d8f1bd304f5d210315.tar.gz
linux-stable-b1b8132a651cf6a5b18a01d8f1bd304f5d210315.tar.bz2
linux-stable-b1b8132a651cf6a5b18a01d8f1bd304f5d210315.zip
vfio: More vfio_file_is_group() use cases
Replace further open coded tests with helper. Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/166516896843.1215571.5378890510536477434.stgit@omen Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r--drivers/vfio/vfio_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c
index 04099a839a52..2d168793d4e1 100644
--- a/drivers/vfio/vfio_main.c
+++ b/drivers/vfio/vfio_main.c
@@ -1615,7 +1615,7 @@ bool vfio_file_enforced_coherent(struct file *file)
struct vfio_group *group = file->private_data;
bool ret;
- if (file->f_op != &vfio_group_fops)
+ if (!vfio_file_is_group(file))
return true;
mutex_lock(&group->group_lock);
@@ -1647,7 +1647,7 @@ void vfio_file_set_kvm(struct file *file, struct kvm *kvm)
{
struct vfio_group *group = file->private_data;
- if (file->f_op != &vfio_group_fops)
+ if (!vfio_file_is_group(file))
return;
mutex_lock(&group->group_lock);
@@ -1667,7 +1667,7 @@ bool vfio_file_has_dev(struct file *file, struct vfio_device *device)
{
struct vfio_group *group = file->private_data;
- if (file->f_op != &vfio_group_fops)
+ if (!vfio_file_is_group(file))
return false;
return group == device->group;