vfio-pci: Fix vfio_pci_ioeventfd() to return int
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 31 Aug 2022 20:15:56 +0000 (17:15 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 1 Sep 2022 21:29:11 +0000 (15:29 -0600)
This only returns 0 or -ERRNO, it should return int like all the other
ioctl dispatch functions.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/1-v2-0f9e632d54fb+d6-vfio_ioctl_split_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_priv.h
drivers/vfio/pci/vfio_pci_rdwr.c

index 4830fb01a1caa2c1444a5e98195ee957fcc6d5a9..58b8d34c162cd617a16f18382ffc74ca8310e2f0 100644 (file)
@@ -48,8 +48,8 @@ static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev,
 }
 #endif
 
-long vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
-                       uint64_t data, int count, int fd);
+int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
+                      uint64_t data, int count, int fd);
 
 int vfio_pci_init_perm_bits(void);
 void vfio_pci_uninit_perm_bits(void);
index d5e9883c1eee107b3042309e55c003565f3df1df..e352a033b4aef770e434a42ebbeece0fbf6eb7a3 100644 (file)
@@ -412,8 +412,8 @@ static void vfio_pci_ioeventfd_thread(void *opaque, void *unused)
        vfio_pci_ioeventfd_do_write(ioeventfd, ioeventfd->test_mem);
 }
 
-long vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
-                       uint64_t data, int count, int fd)
+int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
+                      uint64_t data, int count, int fd)
 {
        struct pci_dev *pdev = vdev->pdev;
        loff_t pos = offset & VFIO_PCI_OFFSET_MASK;