[U-Boot] [PATCH 4/6] x86: fix pci large integer implicitly truncated to unsigned type

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun May 10 17:31:49 CEST 2009


when allowing for PCI addresses to be 64-bit in commint 30e76d5e3bc4

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 lib_i386/pci.c        |    2 +-
 lib_i386/video_bios.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib_i386/pci.c b/lib_i386/pci.c
index 4331b04..f366bdc 100644
--- a/lib_i386/pci.c
+++ b/lib_i386/pci.c
@@ -60,7 +60,7 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
 	       vendor, device, class_code);
 #endif
 	/* Enable the rom addess decoder */
-	pci_write_config_dword(dev, PCI_ROM_ADDRESS, PCI_ROM_ADDRESS_MASK);
+	pci_write_config_dword(dev, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);
 	pci_read_config_dword(dev, PCI_ROM_ADDRESS, &addr_reg);
 
 	if (!addr_reg) {
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index ce96a3e..d9116d4 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -103,7 +103,7 @@ static u32 probe_pci_video(void)
 
 		/* Test the ROM decoder, do the device support a rom? */
 		pci_read_config_dword(devbusfn, PCI_ROM_ADDRESS, &old);
-		pci_write_config_dword(devbusfn, PCI_ROM_ADDRESS, PCI_ROM_ADDRESS_MASK);
+		pci_write_config_dword(devbusfn, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);
 		pci_read_config_dword(devbusfn, PCI_ROM_ADDRESS, &addr);
 		pci_write_config_dword(devbusfn, PCI_ROM_ADDRESS, old);
 
-- 
1.6.2.4



More information about the U-Boot mailing list