From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDxTc-0003Wt-1X for qemu-devel@nongnu.org; Tue, 09 Jun 2009 05:18:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDxTX-0003W3-5V for qemu-devel@nongnu.org; Tue, 09 Jun 2009 05:18:39 -0400 Received: from [199.232.76.173] (port=55601 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDxTW-0003W0-Ra for qemu-devel@nongnu.org; Tue, 09 Jun 2009 05:18:34 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37271) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDxTW-0007Qx-Ga for qemu-devel@nongnu.org; Tue, 09 Jun 2009 05:18:34 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n599IXKj016604 for ; Tue, 9 Jun 2009 05:18:33 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n599IX49006902 for ; Tue, 9 Jun 2009 05:18:33 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n599IWHG022139 for ; Tue, 9 Jun 2009 05:18:32 -0400 Date: Tue, 9 Jun 2009 12:18:31 +0300 From: Gleb Natapov Message-ID: <20090609091831.GT27210@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCHv2] remove unused field from pci device. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Rename pci_irq_index to pci_device_count because this is what it actually does. Signed-off-by: Gleb Natapov 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.