From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken CC Subject: [PATCH 4/4] Rename PCI_FUNC_MAX to PCI_FUNCTIONS_PER_DEVICES in pci.[ch] Date: Tue, 24 Aug 2010 21:28:11 +0800 Message-ID: <20100824132811.GD19469@kt> References: <20100824132525.GA19469@kt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, mst@redhat.com To: yamahata@valinux.co.jp, avi@redhat.com, kvm@vger.kernel.org Return-path: Received: from mail-qy0-f181.google.com ([209.85.216.181]:45221 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755157Ab0HXN2P (ORCPT ); Tue, 24 Aug 2010 09:28:15 -0400 Received: by qyk33 with SMTP id 33so6438577qyk.19 for ; Tue, 24 Aug 2010 06:28:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20100824132525.GA19469@kt> Sender: kvm-owner@vger.kernel.org List-ID: PCI_FUNC_MAX is introduced by 6eab3de16d36c48a983366b09d0a0029a5260bc3 and 6fa84913eccec4266a27c81ae88465f6790742b9 which should be safe to rename to PCI_FUNCTIONS_PER_DEVICES. Signed-off-by: Ken CC --- hw/pci.c | 4 ++-- hw/pci.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index fc4becd..3901455 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -711,7 +711,7 @@ static int pci_init_multifunction(PCIBus *bus, PCIDevice *dev) return 0; } /* function 0 indicates single function, so function > 0 must be NULL */ - for (func = 1; func < PCI_FUNC_MAX; ++func) { + for (func = 1; func < PCI_FUNCTIONS_PER_DEVICE; ++func) { if (bus->devices[PCI_DEVFN(slot, func)]) { error_report("PCI: %x.0 indicates single function, " "but %x.%x is already populated.", @@ -750,7 +750,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, assert(devfn / PCI_FUNCTIONS_PER_DEVICE < PCIBUS_MAX_DEVICES); if (devfn < 0) { for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); - devfn += PCI_FUNC_MAX) { + devfn += PCI_FUNCTIONS_PER_DEVICE) { if (!bus->devices[devfn]) goto found; } diff --git a/hw/pci.h b/hw/pci.h index eb97b76..f6fb6d8 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -16,7 +16,6 @@ struct kvm_irq_routing_entry; #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) -#define PCI_FUNC_MAX 8 #define PCI_FUNCTIONS_PER_DEVICE 8 #define PCIBUS_MAX_DEVICES 32