Size of a BAR is naturally aligned so there is no need to align it explicitly. Cc: Thomas Huth <thuth@xxxxxxxxxx> Cc: Andrew Jones <drjones@xxxxxxxxxx> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx> --- lib/pci-host-generic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/pci-host-generic.c b/lib/pci-host-generic.c index 6ac0f15faa90..df66bd4741e6 100644 --- a/lib/pci-host-generic.c +++ b/lib/pci-host-generic.c @@ -169,7 +169,7 @@ static bool pci_alloc_resource(pcidevaddr_t dev, int bar_num, u64 *addr) { struct pci_host_bridge *host = pci_host_bridge; struct pci_addr_space *as = &host->addr_space[0]; - u32 mask, bar; + u32 bar; u64 size; int type, i; @@ -199,10 +199,7 @@ static bool pci_alloc_resource(pcidevaddr_t dev, int bar_num, u64 *addr) return false; } - mask = pci_bar_mask(bar); - size = ALIGN(size, ~mask + 1); assert(as->allocated + size <= as->size); - *addr = as->pci_start + as->allocated; as->allocated += size; -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html