diff options
author | Yi Liu <yi.l.liu@intel.com> | 2023-07-18 06:55:44 -0700 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2023-07-25 10:19:45 -0600 |
commit | 5c6de3ea73768d1781024e4a41f77d6d71bc64cb (patch) | |
tree | c4ce32ecd51c449bce1579818ede6b620b295e16 /drivers/vfio/vfio.h | |
parent | 8b6f173a4ce47ef0606124710315560c64f2344e (diff) | |
download | lwn-5c6de3ea73768d1781024e4a41f77d6d71bc64cb.tar.gz lwn-5c6de3ea73768d1781024e4a41f77d6d71bc64cb.zip |
vfio: Test kvm pointer in _vfio_device_get_kvm_safe()
This saves some lines when adding the kvm get logic for the vfio_device
cdev path.
This also renames _vfio_device_get_kvm_safe() to be vfio_device_get_kvm_safe().
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718135551.6592-20-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio.h')
-rw-r--r-- | drivers/vfio/vfio.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h index fb8f2fac3d23..c2aa65382592 100644 --- a/drivers/vfio/vfio.h +++ b/drivers/vfio/vfio.h @@ -340,11 +340,11 @@ enum { vfio_noiommu = false }; #endif #ifdef CONFIG_HAVE_KVM -void _vfio_device_get_kvm_safe(struct vfio_device *device, struct kvm *kvm); +void vfio_device_get_kvm_safe(struct vfio_device *device, struct kvm *kvm); void vfio_device_put_kvm(struct vfio_device *device); #else -static inline void _vfio_device_get_kvm_safe(struct vfio_device *device, - struct kvm *kvm) +static inline void vfio_device_get_kvm_safe(struct vfio_device *device, + struct kvm *kvm) { } |