Skip to contentSkip to conversation

PCI: pbus_size_mem() fix

PATCH New Ivan Kokshaysky 1 participant 1 message Mar 12, 2003 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: pbus_size_mem() fix

This fixes long standing typo ('size' instead of 'r_size') which causes overestimate of the bridge memory ranges calculated in pbus_size_mem(). For example, if we have a device with one 1Mb and one 2Mb memory ranges behind the bridge, calculated size and alignment of the bridge memory window will be 4Mb and 2Mb respectively, while the correct values are 3Mb and 1Mb.

Ivan.

drivers/pci/setup-bus.c +1 -1
@@ -284,7 +284,7 @@ pbus_size_mem(struct pci_bus *bus, unsig
 				order = 0;
 			/* Exclude ranges with size > align from
 			   calculation of the alignment. */
-			if (size == align)
+			if (r_size == align)
 				aligns[order] += align;
 			if (order > max_order)
 				max_order = order;