Skip to contentSkip to conversation

vfio: Clean up vfio_region_unmap()

PATCH In review Xiaoyao Li 2 participants 2 messages May 19 – May 21

lore
Share & tools
lore

Xiaoyao Li

author
#0 lore raw

PATCH 1/1 vfio: Clean up vfio_region_unmap()

Since commit 7429aebe1cff ("vfio/migration: Remove VFIO migration protocol v1"), vfio_region_unmap() lost all its callers.

Remove unused vfio_region_unmap().

---
 hw/vfio/region.c      | 15 ---------------
 hw/vfio/vfio-region.h |  1 -
 2 files changed, 16 deletions(-)
hw/vfio/region.c +0 -15
index 0342ca712acd..dbde33918026 100644
@@ -468,21 +468,6 @@ no_mmap:
     return ret;
 }
 
-void vfio_region_unmap(VFIORegion *region)
-{
-    int i;
-
-    if (!region->mem) {
-        return;
-    }
-
-    for (i = 0; i < region->nr_mmaps; i++) {
-        if (region->mmaps[i].mmap) {
-            vfio_subregion_unmap(region, i);
-        }
-    }
-}
-
 void vfio_region_exit(VFIORegion *region)
 {
     int i;
hw/vfio/vfio-region.h +0 -1
index 9b21d4ee5ba1..58b236f1133e 100644
@@ -41,7 +41,6 @@ int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,
                       int index, const char *name, Error **errp);
 int vfio_region_mmap(VFIORegion *region);
 void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled);
-void vfio_region_unmap(VFIORegion *region);
 void vfio_region_exit(VFIORegion *region);
 void vfio_region_finalize(VFIORegion *region);
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Xiaoyao Li

Since commit 7429aebe1cff ("vfio/migration: Remove VFIO migration protocol v1"), vfio_region_unmap() lost all its callers.

Remove unused vfio_region_unmap().

Thanks,

C.

Quoted 43 lines
---
  hw/vfio/region.c      | 15 ---------------
  hw/vfio/vfio-region.h |  1 -
  2 files changed, 16 deletions(-)
hw/vfio/region.c +0 -15
index 0342ca712acd..dbde33918026 100644
@@ -468,21 +468,6 @@ no_mmap:
      return ret;
  }
 
-void vfio_region_unmap(VFIORegion *region)
-{
-    int i;
-
-    if (!region->mem) {
-        return;
-    }
-
-    for (i = 0; i < region->nr_mmaps; i++) {
-        if (region->mmaps[i].mmap) {
-            vfio_subregion_unmap(region, i);
-        }
-    }
-}
-
  void vfio_region_exit(VFIORegion *region)
  {
      int i;
hw/vfio/vfio-region.h +0 -1
index 9b21d4ee5ba1..58b236f1133e 100644
@@ -41,7 +41,6 @@ int vfio_region_setup(Object *obj, VFIODevice *vbasedev, VFIORegion *region,
                        int index, const char *name, Error **errp);
  int vfio_region_mmap(VFIORegion *region);
  void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled);
-void vfio_region_unmap(VFIORegion *region);
  void vfio_region_exit(VFIORegion *region);
  void vfio_region_finalize(VFIORegion *region);