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

Wolfgang Denk wd at denx.de
Mon May 11 09:16:45 CEST 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1241969511-4497-4-git-send-email-plagnioj at jcrosoft.com> you wrote:
> 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);

Ummm... but when we have 64 bit PIC addresses, then truncating these
to 32 bit (either implicitly or explicitly) is wrong.  Instead of
fixing the problem, you just hush up the compiler warning.  NAK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Love sometimes expresses itself in sacrifice.
	-- Kirk, "Metamorphosis", stardate 3220.3


More information about the U-Boot mailing list