Skip to contentSkip to conversation

remove unused field from pci device.

PATCH Superseded Gleb Natapov 3 participants 5 messages Jun 8, 2009 – Jun 9, 2009

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove unused field from pci device.

hw/pci.c +1 -1
index 0ab5b94..02b335f 100644
@@ -268,7 +268,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
         config_write = pci_default_write_config;
     pci_dev->config_read = config_read;
     pci_dev->config_write = config_write;
-    pci_dev->irq_index = pci_irq_index++;
+    pci_irq_index++;
     bus->devices[devfn] = pci_dev;
     pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
     return pci_dev;
hw/pci.h +0 -2
index 0405837..fb7b89a 100644
@@ -154,8 +154,6 @@ struct PCIDevice {
     PCIConfigReadFunc *config_read;
     PCIConfigWriteFunc *config_write;
     PCIUnregisterFunc *unregister;
-    /* ??? This is a PC-specific hack, and should be removed.  */
-    int irq_index;
 
     /* IRQ objects for the INTA-INTD pins.  */
     qemu_irq *irq;

--
Gleb.

#1 lore raw
Quoted 22 lines · Gleb Natapov

diff --git a/hw/pci.c b/hw/pci.c
index 0ab5b94..02b335f 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -268,7 +268,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,

         config_write = pci_default_write_config;
     pci_dev->config_read = config_read;
     pci_dev->config_write = config_write;
 -    pci_dev->irq_index = pci_irq_index++;
 +    pci_irq_index++;
     bus->devices[devfn] = pci_dev;
     pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
     return pci_dev;
 diff --git a/hw/pci.h b/hw/pci.h
 index 0405837..fb7b89a 100644
 --- a/hw/pci.h
 +++ b/hw/pci.h
 @@ -154,8 +154,6 @@ struct PCIDevice {
     PCIConfigReadFunc *config_read;
     PCIConfigWriteFunc *config_write;
     PCIUnregisterFunc *unregister;
Quoted 5 lines

- /* ??? This is a PC-specific hack, and should be removed. */
- int irq_index;

     /* IRQ objects for the INTA-INTD pins.  */
     qemu_irq *irq;

After the patch, pci_irq_index no longer tracks irqs but how many PCI devices there are in the system, so perhaps it should be renamed as well.

#2 lore raw
Quoted 26 lines · Blue Swirl
Quoted 25 lines · Gleb Natapov

diff --git a/hw/pci.c b/hw/pci.c
index 0ab5b94..02b335f 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -268,7 +268,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,

         config_write = pci_default_write_config;
     pci_dev->config_read = config_read;
     pci_dev->config_write = config_write;
 -    pci_dev->irq_index = pci_irq_index++;
 +    pci_irq_index++;
     bus->devices[devfn] = pci_dev;
     pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
     return pci_dev;
 diff --git a/hw/pci.h b/hw/pci.h
 index 0405837..fb7b89a 100644
 --- a/hw/pci.h
 +++ b/hw/pci.h
 @@ -154,8 +154,6 @@ struct PCIDevice {
     PCIConfigReadFunc *config_read;
     PCIConfigWriteFunc *config_write;
     PCIUnregisterFunc *unregister;

- /* ??? This is a PC-specific hack, and should be removed. */
- int irq_index;

Quoted 6 lines
Quoted 2 lines
     /* IRQ objects for the INTA-INTD pins.  */
     qemu_irq *irq;

After the patch, pci_irq_index no longer tracks irqs but how many PCI devices there are in the system, so perhaps it should be renamed as well.

pci_irq_index tracked the number of PCI devices before this patch too since irq_index is unused anyway. Do you want me to resend the patch with renaming or do renaming in separate patch?

--
Gleb.

#3 lore raw
Quoted 30 lines · Gleb Natapov
Quoted 29 lines · Blue Swirl
Quoted 27 lines · Gleb Natapov

diff --git a/hw/pci.c b/hw/pci.c
index 0ab5b94..02b335f 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -268,7 +268,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,

         config_write = pci_default_write_config;
     pci_dev->config_read = config_read;
     pci_dev->config_write = config_write;
 -    pci_dev->irq_index = pci_irq_index++;
 +    pci_irq_index++;
     bus->devices[devfn] = pci_dev;
     pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
     return pci_dev;
 diff --git a/hw/pci.h b/hw/pci.h
 index 0405837..fb7b89a 100644
 --- a/hw/pci.h
 +++ b/hw/pci.h
 @@ -154,8 +154,6 @@ struct PCIDevice {
     PCIConfigReadFunc *config_read;
     PCIConfigWriteFunc *config_write;
     PCIUnregisterFunc *unregister;

- /* ??? This is a PC-specific hack, and should be removed. */
- int irq_index;

     /* IRQ objects for the INTA-INTD pins.  */
     qemu_irq *irq;
Quoted 7 lines
Quoted 3 lines

After the patch, pci_irq_index no longer tracks irqs but how many PCI devices there are in the system, so perhaps it should be renamed as well.

pci_irq_index tracked the number of PCI devices before this patch too
since irq_index is unused anyway. Do you want me to resend the patch with renaming or do renaming in separate patch?

I guess it does not affect bisectability if you also do renaming in the same patch.

#4 lore raw
In reply to Gleb Natapov

Hi. As qdev has been introduced, the member PCIBus *bus becomes also unnecessary because qdev layer tracks bus-device relation. I already sent a patch to clean it up, I haven't got any reply.
http://lists.gnu.org/archive/html/qemu-devel/2009-06/msg00031.html

If such a patch is acceptable, I'm willing to rebase it and send it out. Is the patch wanted?

Quoted 27 lines · Gleb Natapov
hw/pci.c +1 -1
index 0ab5b94..02b335f 100644
@@ -268,7 +268,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
         config_write = pci_default_write_config;
     pci_dev->config_read = config_read;
     pci_dev->config_write = config_write;
-    pci_dev->irq_index = pci_irq_index++;
+    pci_irq_index++;
     bus->devices[devfn] = pci_dev;
     pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
     return pci_dev;
hw/pci.h +0 -2
index 0405837..fb7b89a 100644
@@ -154,8 +154,6 @@ struct PCIDevice {
     PCIConfigReadFunc *config_read;
     PCIConfigWriteFunc *config_write;
     PCIUnregisterFunc *unregister;
-    /* ??? This is a PC-specific hack, and should be removed.  */
-    int irq_index;
 
     /* IRQ objects for the INTA-INTD pins.  */
     qemu_irq *irq;
Signature · 1 line
yamahata