]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib_i386/pci.c
ep93xx timer: Fix possible overflow in usecs_to_ticks()
[people/ms/u-boot.git] / lib_i386 / pci.c
index a7f16aa53b626ac1cb73a386317c016ccc78ea69..9020e7ce7646df66ab777244cffb59f57ef9efb1 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 
-#ifdef CONFIG_PCI
 #undef PCI_ROM_SCAN_VERBOSE
 
 int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
@@ -52,7 +51,7 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
        pci_read_config_word(dev, PCI_DEVICE_ID, &device);
        pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_code);
 
-       class_code &= 0xffffff00;
+       class_code &= 0xffffff00;
        class_code >>= 8;
 
 #if 0
@@ -60,7 +59,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) {
@@ -103,7 +102,7 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
                                printf("%s\n",
                                       (readw(pci_data+0x15) &0x80)?
                                       "Last image":"More images follow");
-                               switch  (readb(pci_data+0x14)) {
+                               switch  (readb(pci_data+0x14)) {
                                case 0:
                                        printf("X86 code\n");
                                        break;
@@ -151,5 +150,3 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest)
 
        return res;
 }
-
-#endif