* [Qemu-devel] [PATCHv2] remove unused field from pci device.
@ 2009-06-09 9:18 Gleb Natapov
2009-06-09 13:01 ` Paul Brook
0 siblings, 1 reply; 5+ messages in thread
From: Gleb Natapov @ 2009-06-09 9:18 UTC (permalink / raw)
To: qemu-devel
Rename pci_irq_index to pci_device_count because this is what it
actually does.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/hw/pci.c b/hw/pci.c
index 0ab5b94..d00041a 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -54,7 +54,7 @@ static void pci_set_irq(void *opaque, int irq_num, int level);
target_phys_addr_t pci_mem_base;
static uint16_t pci_default_sub_vendor_id = PCI_SUBVENDOR_ID_REDHAT_QUMRANET;
static uint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_QEMU;
-static int pci_irq_index;
+static int pci_device_count;
static PCIBus *first_bus;
static void pcibus_save(QEMUFile *f, void *opaque)
@@ -245,7 +245,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
PCIConfigReadFunc *config_read,
PCIConfigWriteFunc *config_write)
{
- if (pci_irq_index >= PCI_DEVICES_MAX)
+ if (pci_device_count >= PCI_DEVICES_MAX)
return NULL;
if (devfn < 0) {
@@ -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_device_count++;
bus->devices[devfn] = pci_dev;
pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
return pci_dev;
@@ -322,7 +322,7 @@ int pci_unregister_device(PCIDevice *pci_dev)
pci_unregister_io_regions(pci_dev);
qemu_free_irqs(pci_dev->irq);
- pci_irq_index--;
+ pci_device_count--;
pci_dev->bus->devices[pci_dev->devfn] = NULL;
qdev_free(&pci_dev->qdev);
return 0;
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;
--
Gleb.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCHv2] remove unused field from pci device.
2009-06-09 9:18 [Qemu-devel] [PATCHv2] remove unused field from pci device Gleb Natapov
@ 2009-06-09 13:01 ` Paul Brook
2009-06-09 13:03 ` Gleb Natapov
0 siblings, 1 reply; 5+ messages in thread
From: Paul Brook @ 2009-06-09 13:01 UTC (permalink / raw)
To: qemu-devel; +Cc: Gleb Natapov
On Tuesday 09 June 2009, Gleb Natapov wrote:
> Rename pci_irq_index to pci_device_count because this is what it
> actually does.
This whole thing looks bogus. AFAICS the limit is completely arbitrary and
unnecessary.
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCHv2] remove unused field from pci device.
2009-06-09 13:01 ` Paul Brook
@ 2009-06-09 13:03 ` Gleb Natapov
2009-06-09 13:11 ` Paul Brook
0 siblings, 1 reply; 5+ messages in thread
From: Gleb Natapov @ 2009-06-09 13:03 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel
On Tue, Jun 09, 2009 at 02:01:52PM +0100, Paul Brook wrote:
> On Tuesday 09 June 2009, Gleb Natapov wrote:
> > Rename pci_irq_index to pci_device_count because this is what it
> > actually does.
>
> This whole thing looks bogus. AFAICS the limit is completely arbitrary and
> unnecessary.
>
So? Left it bogus with unused field and cryptic name instead?
--
Gleb.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCHv2] remove unused field from pci device.
2009-06-09 13:03 ` Gleb Natapov
@ 2009-06-09 13:11 ` Paul Brook
2009-06-09 13:22 ` Gleb Natapov
0 siblings, 1 reply; 5+ messages in thread
From: Paul Brook @ 2009-06-09 13:11 UTC (permalink / raw)
To: Gleb Natapov; +Cc: qemu-devel
On Tuesday 09 June 2009, Gleb Natapov wrote:
> On Tue, Jun 09, 2009 at 02:01:52PM +0100, Paul Brook wrote:
> > On Tuesday 09 June 2009, Gleb Natapov wrote:
> > > Rename pci_irq_index to pci_device_count because this is what it
> > > actually does.
> >
> > This whole thing looks bogus. AFAICS the limit is completely arbitrary
> > and unnecessary.
>
> So? Left it bogus with unused field and cryptic name instead?
No. Remove the whole thing.
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCHv2] remove unused field from pci device.
2009-06-09 13:11 ` Paul Brook
@ 2009-06-09 13:22 ` Gleb Natapov
0 siblings, 0 replies; 5+ messages in thread
From: Gleb Natapov @ 2009-06-09 13:22 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel
On Tue, Jun 09, 2009 at 02:11:58PM +0100, Paul Brook wrote:
> On Tuesday 09 June 2009, Gleb Natapov wrote:
> > On Tue, Jun 09, 2009 at 02:01:52PM +0100, Paul Brook wrote:
> > > On Tuesday 09 June 2009, Gleb Natapov wrote:
> > > > Rename pci_irq_index to pci_device_count because this is what it
> > > > actually does.
> > >
> > > This whole thing looks bogus. AFAICS the limit is completely arbitrary
> > > and unnecessary.
> >
> > So? Left it bogus with unused field and cryptic name instead?
>
> No. Remove the whole thing.
Well, not with may understanding of that code, but if somebody wants to
do it...
--
Gleb.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-09 13:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 9:18 [Qemu-devel] [PATCHv2] remove unused field from pci device Gleb Natapov
2009-06-09 13:01 ` Paul Brook
2009-06-09 13:03 ` Gleb Natapov
2009-06-09 13:11 ` Paul Brook
2009-06-09 13:22 ` Gleb Natapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).