Skip to contentSkip to conversation

vfio/spapr: Remove stale ioctl() call

PATCH In review David Gibson 2 participants 2 messages Jul 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/spapr: Remove stale ioctl() call

This ioctl() call to VFIO_IOMMU_SPAPR_TCE_REMOVE was left over from an earlier version of the code and has since been folded into vfio_spapr_remove_window().

It wasn't caught because although the argument structure has been removed, the libc function remove() means this didn't trigger a compile failure. The ioctl() was also almost certain to fail silently and harmlessly with the bogus argument, so this wasn't caught in testing.

---
 hw/vfio/spapr.c | 1 -
 1 file changed, 1 deletion(-)

Alexey, I've already put this tentatively into ppc-for-2.7, but I'd appreciate an ack before I send my next pull request.

hw/vfio/spapr.c +0 -1
index 0af3423..7443d34 100644
@@ -177,7 +177,6 @@ int vfio_spapr_create_window(VFIOContainer *container,
         error_report("Host doesn't support DMA window at %"HWADDR_PRIx", must be %"PRIx64,
                      section->offset_within_address_space,
                      (uint64_t)create.start_addr);
-        ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove);
         return -EINVAL;
     }
     trace_vfio_spapr_create_window(create.page_shift,
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · David Gibson

This ioctl() call to VFIO_IOMMU_SPAPR_TCE_REMOVE was left over from an earlier version of the code and has since been folded into vfio_spapr_remove_window().

It wasn't caught because although the argument structure has been removed, the libc function remove() means this didn't trigger a compile failure. The ioctl() was also almost certain to fail silently and harmlessly with the bogus argument, so this wasn't caught in testing.

Quoted 20 lines
---
 hw/vfio/spapr.c | 1 -
 1 file changed, 1 deletion(-)

Alexey, I've already put this tentatively into ppc-for-2.7, but I'd appreciate an ack before I send my next pull request.

hw/vfio/spapr.c +0 -1
index 0af3423..7443d34 100644
@@ -177,7 +177,6 @@ int vfio_spapr_create_window(VFIOContainer *container,
         error_report("Host doesn't support DMA window at %"HWADDR_PRIx", must be %"PRIx64,
                      section->offset_within_address_space,
                      (uint64_t)create.start_addr);
-        ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove);
         return -EINVAL;
     }
     trace_vfio_spapr_create_window(create.page_shift,
Signature · 1 line
Alexey