From: Wolfgang Denk Date: Mon, 11 May 2009 09:16:45 +0200 Subject: [U-Boot] [PATCH 4/6] x86: fix pci large integer implicitly truncated to unsigned type In-Reply-To: <1241969511-4497-4-git-send-email-plagnioj@jcrosoft.com> References: <1241969511-4497-1-git-send-email-plagnioj@jcrosoft.com> <1241969511-4497-2-git-send-email-plagnioj@jcrosoft.com> <1241969511-4497-3-git-send-email-plagnioj@jcrosoft.com> <1241969511-4497-4-git-send-email-plagnioj@jcrosoft.com> Message-ID: <20090511071645.8FBBC832E416@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Jean-Christophe PLAGNIOL-VILLARD, In message <1241969511-4497-4-git-send-email-plagnioj@jcrosoft.com> you wrote: > when allowing for PCI addresses to be 64-bit in commint 30e76d5e3bc4 > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > 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