public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] PCI: fix search for suitable memory region
@ 2015-11-13 10:06 Andre Przywara
  2015-11-13 10:34 ` Bin Meng
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Przywara @ 2015-11-13 10:06 UTC (permalink / raw)
  To: u-boot

Binary ANDing a value with 0 and comparing it against 0 always
yields true, I guess that's not intended here.
Use the proper mask value for the memory region type bit.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/pci/pci_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci_common.c b/drivers/pci/pci_common.c
index 07f1726..b8a9a14 100644
--- a/drivers/pci/pci_common.c
+++ b/drivers/pci/pci_common.c
@@ -231,7 +231,7 @@ phys_addr_t pci_hose_bus_to_phys(struct pci_controller *hose,
 	 * if PCI_REGION_MEM is set we do a two pass search with preference
 	 * on matches that don't have PCI_REGION_SYS_MEMORY set
 	 */
-	if ((flags & PCI_REGION_MEM) == PCI_REGION_MEM) {
+	if ((flags & PCI_REGION_TYPE) == PCI_REGION_MEM) {
 		ret = __pci_hose_bus_to_phys(hose, bus_addr,
 				flags, PCI_REGION_SYS_MEMORY, &phys_addr);
 		if (!ret)
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-13 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 10:06 [U-Boot] [PATCH] PCI: fix search for suitable memory region Andre Przywara
2015-11-13 10:34 ` Bin Meng
2015-11-13 10:53   ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox