diff mbox

[kvm-unit-tests,1/2] pci: Remove redundant alignment of BAR size

Message ID 11e19e7883e1c2085bf348edcb16d79fa8bad3e8.1480069555.git.agordeev@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexander Gordeev Nov. 25, 2016, 10:29 a.m. UTC
Size of a BAR is naturally aligned so there is no need
to align it explicitly.

Cc: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 lib/pci-host-generic.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox

Patch

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;