]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/pci: Replace uses of vfio_device_data() with container_of
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 30 Mar 2021 15:53:08 +0000 (09:53 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Apr 2021 17:55:11 +0000 (11:55 -0600)
commit6bbdb9895f294c3c691609cfabfa02e4e475bb71
tree061279e8301a8e031932304a6a8ab8f061c2cdd9
parent29e6b1b254035e929312fbdd25b29ca006f02aff
vfio/pci: Replace uses of vfio_device_data() with container_of

This tidies a few confused places that think they can have a refcount on
the vfio_device but the device_data could be NULL, that isn't possible by
design.

Most of the change falls out when struct vfio_devices is updated to just
store the struct vfio_pci_device itself. This wasn't possible before
because there was no easy way to get from the 'struct vfio_pci_device' to
the 'struct vfio_device' to put back the refcount.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <13-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci.c