qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 4/4] Rename PCI_FUNC_MAX to PCI_FUNCTIONS_PER_DE


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 4/4] Rename PCI_FUNC_MAX to PCI_FUNCTIONS_PER_DEVICES in pci.[ch]
Date: Tue, 7 Sep 2010 20:22:11 +0300
User-agent: Mutt/1.5.20 (2009-12-10)

On Tue, Aug 24, 2010 at 09:28:11PM +0800, Ken CC wrote:
> 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 <address@hidden>

I liked the shorter name better ...

> ---
>  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
>  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]