Skip to contentSkip to conversation

hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init

PATCH Applied Philippe Mathieu-Daudé 3 participants 3 messages Jan 5, 2023 – Jan 16, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init

This argument was added 9 years ago in commit 83d08f2673 ("pc: map PCI address space as catchall region for not mapped addresses") and has never been used since, so remove it.

---
 hw/i386/pc.c         | 2 +-
 hw/pci-host/i440fx.c | 3 +--
 hw/pci-host/q35.c    | 3 +--
 include/hw/i386/pc.h | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)
hw/i386/pc.c +1 -1
index d489ecc0d1..6e592bd969 100644
@@ -782,7 +782,7 @@ void pc_guest_info_init(PCMachineState *pcms)
 }
 
 /* setup pci memory address space mapping into system address space */
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                             MemoryRegion *pci_address_space)
 {
     /* Set to lower priority than RAM */
hw/pci-host/i440fx.c +1 -2
index d5426ef4a5..262f82c303 100644
@@ -272,8 +272,7 @@ PCIBus *i440fx_init(const char *pci_type,
                      IO_APIC_DEFAULT_ADDRESS - 1);
 
     /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(f), f->system_memory,
-                           f->pci_address_space);
+    pc_pci_as_mapping_init(f->system_memory, f->pci_address_space);
 
     /* if *disabled* show SMRAM to all CPUs */
     memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region",
hw/pci-host/q35.c +1 -2
index 20da121374..26390863d6 100644
@@ -574,8 +574,7 @@ static void mch_realize(PCIDevice *d, Error **errp)
     }
 
     /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,
-                           mch->pci_address_space);
+    pc_pci_as_mapping_init(mch->system_memory, mch->pci_address_space);
 
     /* if *disabled* show SMRAM to all CPUs */
     memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region",
include/hw/i386/pc.h +1 -1
index 991f905f5d..88a120bc23 100644
@@ -156,7 +156,7 @@ void pc_guest_info_init(PCMachineState *pcms);
 #define PCI_HOST_ABOVE_4G_MEM_SIZE     "above-4g-mem-size"
 
 
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                             MemoryRegion *pci_address_space);
 
 void xen_load_linux(PCMachineState *pcms);
Signature · 1 line
2.38.1
Reviewed-by on v2 1/1
#1 lore raw

Am 5. Januar 2023 17:38:26 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 5 lines

This argument was added 9 years ago in commit 83d08f2673 ("pc: map PCI address space as catchall region for not mapped addresses") and has never been used since, so remove it.

Quoted 61 lines

---

hw/i386/pc.c         | 2 +-
hw/pci-host/i440fx.c | 3 +--
hw/pci-host/q35.c    | 3 +--
include/hw/i386/pc.h | 2 +-
4 files changed, 4 insertions(+), 6 deletions(-)
hw/i386/pc.c +1 -1
index d489ecc0d1..6e592bd969 100644
@@ -782,7 +782,7 @@ void pc_guest_info_init(PCMachineState *pcms)
 }
 
 /* setup pci memory address space mapping into system address space */
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                            MemoryRegion *pci_address_space)
 {
    /* Set to lower priority than RAM */
hw/pci-host/i440fx.c +1 -2
index d5426ef4a5..262f82c303 100644
@@ -272,8 +272,7 @@ PCIBus *i440fx_init(const char *pci_type,
                     IO_APIC_DEFAULT_ADDRESS - 1);
 
    /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(f), f->system_memory,
-                           f->pci_address_space);
+    pc_pci_as_mapping_init(f->system_memory, f->pci_address_space);
 
    /* if *disabled* show SMRAM to all CPUs */
    memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region",
hw/pci-host/q35.c +1 -2
index 20da121374..26390863d6 100644
@@ -574,8 +574,7 @@ static void mch_realize(PCIDevice *d, Error **errp)
    }
 
    /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,
-                           mch->pci_address_space);
+    pc_pci_as_mapping_init(mch->system_memory, mch->pci_address_space);
 
    /* if *disabled* show SMRAM to all CPUs */
    memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region",
include/hw/i386/pc.h +1 -1
index 991f905f5d..88a120bc23 100644
@@ -156,7 +156,7 @@ void pc_guest_info_init(PCMachineState *pcms);
 #define PCI_HOST_ABOVE_4G_MEM_SIZE     "above-4g-mem-size"
 
 
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                            MemoryRegion *pci_address_space);
 
 void xen_load_linux(PCMachineState *pcms);
#2 lore raw
In reply to Philippe Mathieu-Daudé

Le 05/01/2023 à 18:38, Philippe Mathieu-Daudé a écrit :

Quoted 58 lines

This argument was added 9 years ago in commit 83d08f2673 ("pc: map PCI address space as catchall region for not mapped addresses") and has never been used since, so remove it.

---
  hw/i386/pc.c         | 2 +-
  hw/pci-host/i440fx.c | 3 +--
  hw/pci-host/q35.c    | 3 +--
  include/hw/i386/pc.h | 2 +-
  4 files changed, 4 insertions(+), 6 deletions(-)
hw/i386/pc.c +1 -1
index d489ecc0d1..6e592bd969 100644
@@ -782,7 +782,7 @@ void pc_guest_info_init(PCMachineState *pcms)
  }
 
  /* setup pci memory address space mapping into system address space */
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                              MemoryRegion *pci_address_space)
  {
      /* Set to lower priority than RAM */
hw/pci-host/i440fx.c +1 -2
index d5426ef4a5..262f82c303 100644
@@ -272,8 +272,7 @@ PCIBus *i440fx_init(const char *pci_type,
                       IO_APIC_DEFAULT_ADDRESS - 1);
 
      /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(f), f->system_memory,
-                           f->pci_address_space);
+    pc_pci_as_mapping_init(f->system_memory, f->pci_address_space);
 
      /* if *disabled* show SMRAM to all CPUs */
      memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region",
hw/pci-host/q35.c +1 -2
index 20da121374..26390863d6 100644
@@ -574,8 +574,7 @@ static void mch_realize(PCIDevice *d, Error **errp)
      }
 
      /* setup pci memory mapping */
-    pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,
-                           mch->pci_address_space);
+    pc_pci_as_mapping_init(mch->system_memory, mch->pci_address_space);
 
      /* if *disabled* show SMRAM to all CPUs */
      memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region",
include/hw/i386/pc.h +0 -0
index 991f905f5d..88a120bc23 100644

include/hw/i386/pc.h void pc_guest_info_init(PCMachineState *pcms); · line 162

Quoted 8 lines
include/hw/i386/pc.h +1 -1
@@ -156,7 +156,7 @@ void pc_guest_info_init(PCMachineState *pcms);
  #define PCI_HOST_ABOVE_4G_MEM_SIZE     "above-4g-mem-size"
 
 
-void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
+void pc_pci_as_mapping_init(MemoryRegion *system_memory,
                              MemoryRegion *pci_address_space);
 
  void xen_load_linux(PCMachineState *pcms);

Applied to my trivial-patches branch.

Thanks,
Laurent