qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/12] Calculate pci region stats on demand


From: Kevin O'Connor
Subject: Re: [Qemu-devel] [PATCH 10/12] Calculate pci region stats on demand
Date: Tue, 24 Apr 2012 21:14:25 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Apr 24, 2012 at 06:24:27PM +1200, Alexey Korolev wrote:
> Do not store pci region stats - instead calulate the
> sum and alignment on demand.
[...]
> @@ -446,9 +459,9 @@ static int pci_bios_check_devices(struct pci_bus *busses)
>          for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {
>              u64 align = (type == PCI_REGION_TYPE_IO) ?
>                  PCI_BRIDGE_IO_MIN : PCI_BRIDGE_MEM_MIN;
> -            if (s->r[type].align > align)
> -                align = s->r[type].align;
> -            u64 size = ALIGN(s->r[type].sum, align);
> +            if (pci_region_align(&s->r[type]) > align)
> +                 align = pci_region_align(&s->r[type]);
> +            u64 size = ALIGN(pci_region_sum(&s->r[type]), align);
[...]
> +    r_end->base = ALIGN_DOWN((BUILD_PCIMEM_END - pci_region_sum(r_end)),
> +                                pci_region_align(r_end));
> +    r_start->base = ALIGN_DOWN((r_end->base - pci_region_sum(r_start)),
> +                                pci_region_align(r_start));

I'd avoid making function calls in the parameter of a macro (it can be
executed multiple times and it's non-obvious).

-Kevin



reply via email to

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