Skip to content

Commit b44a06b

Browse files
ramesh-thomasawilliam
authored andcommitted
vfio/pci: Remove #ifdef iowrite64 and #ifdef ioread64
Remove the #ifdef iowrite64 and #ifdef ioread64 checks around calls to 64 bit IO access. Since default implementations have been enabled, the checks are not required. Signed-off-by: Ramesh Thomas <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent 2b938e3 commit b44a06b

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/vfio/pci/vfio_pci_rdwr.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ EXPORT_SYMBOL_GPL(vfio_pci_core_iowrite##size);
6262
VFIO_IOWRITE(8)
6363
VFIO_IOWRITE(16)
6464
VFIO_IOWRITE(32)
65-
#ifdef iowrite64
6665
VFIO_IOWRITE(64)
67-
#endif
6866

6967
#define VFIO_IOREAD(size) \
7068
int vfio_pci_core_ioread##size(struct vfio_pci_core_device *vdev, \
@@ -90,9 +88,7 @@ EXPORT_SYMBOL_GPL(vfio_pci_core_ioread##size);
9088
VFIO_IOREAD(8)
9189
VFIO_IOREAD(16)
9290
VFIO_IOREAD(32)
93-
#ifdef ioread64
9491
VFIO_IOREAD(64)
95-
#endif
9692

9793
#define VFIO_IORDWR(size) \
9894
static int vfio_pci_iordwr##size(struct vfio_pci_core_device *vdev,\
@@ -128,9 +124,7 @@ static int vfio_pci_iordwr##size(struct vfio_pci_core_device *vdev,\
128124
VFIO_IORDWR(8)
129125
VFIO_IORDWR(16)
130126
VFIO_IORDWR(32)
131-
#if defined(ioread64) && defined(iowrite64)
132127
VFIO_IORDWR(64)
133-
#endif
134128

135129
/*
136130
* Read or write from an __iomem region (MMIO or I/O port) with an excluded
@@ -156,15 +150,13 @@ ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
156150
else
157151
fillable = 0;
158152

159-
#if defined(ioread64) && defined(iowrite64)
160153
if (fillable >= 8 && !(off % 8)) {
161154
ret = vfio_pci_iordwr64(vdev, iswrite, test_mem,
162155
io, buf, off, &filled);
163156
if (ret)
164157
return ret;
165158

166159
} else
167-
#endif
168160
if (fillable >= 4 && !(off % 4)) {
169161
ret = vfio_pci_iordwr32(vdev, iswrite, test_mem,
170162
io, buf, off, &filled);
@@ -382,12 +374,10 @@ static void vfio_pci_ioeventfd_do_write(struct vfio_pci_ioeventfd *ioeventfd,
382374
vfio_pci_core_iowrite32(ioeventfd->vdev, test_mem,
383375
ioeventfd->data, ioeventfd->addr);
384376
break;
385-
#ifdef iowrite64
386377
case 8:
387378
vfio_pci_core_iowrite64(ioeventfd->vdev, test_mem,
388379
ioeventfd->data, ioeventfd->addr);
389380
break;
390-
#endif
391381
}
392382
}
393383

@@ -441,10 +431,8 @@ int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
441431
pos >= vdev->msix_offset + vdev->msix_size))
442432
return -EINVAL;
443433

444-
#ifndef iowrite64
445434
if (count == 8)
446435
return -EINVAL;
447-
#endif
448436

449437
ret = vfio_pci_core_setup_barmap(vdev, bar);
450438
if (ret)

0 commit comments

Comments
 (0)