Imported Upstream version 24.2
[rrq/maintain_lilo.git] / src / device.c
index 93d3039a13ab153c366ce31b22afe69826870e20..3abb836d75bd52d1e66cb467a8931b3c66916086 100644 (file)
@@ -2,7 +2,7 @@
  * 
  * Copyright 1992-1997 Werner Almesberger
  * Copyright 1999-2006 John Coffman
- * Copyright 2009-2011 Joachim Wiedorn
+ * Copyright 2009-2015 Joachim Wiedorn
  * All rights reserved.
  * 
  * Licensed under the terms contained in the file 'COPYING'
@@ -347,7 +347,6 @@ void preload_dev_cache(void)
        cache_add(DEV_DIR "/fd1", 0x0201);
     }
     
-#if 1
     cache_ide(DEV_DISK_DIR "/hdt", MAJOR_IDE10);
     cache_ide(DEV_DISK_DIR "/hds", MAJOR_IDE10);
     cache_ide(DEV_DISK_DIR "/hdr", MAJOR_IDE9);
@@ -360,11 +359,9 @@ void preload_dev_cache(void)
     
     cache_ide(DEV_DISK_DIR "/hdl", MAJOR_IDE6);
     cache_ide(DEV_DISK_DIR "/hdk", MAJOR_IDE6);
-#ifdef MAJOR_IDE5
+
     cache_ide(DEV_DISK_DIR "/hdj", MAJOR_IDE5);
     cache_ide(DEV_DISK_DIR "/hdi", MAJOR_IDE5);
-#endif
-#endif
     
     for (i = MAX; i >= 0; i--) {
        sprintf(tmp, is_devfs() ? DEV_DISK_DIR "/md/%d" : DEV_DISK_DIR "/md%d", i);
@@ -385,8 +382,8 @@ void preload_dev_cache(void)
 
     cache_ide(DEV_DISK_DIR "/hdd", MAJOR_IDE2);
     cache_ide(DEV_DISK_DIR "/hdc", MAJOR_IDE2);
-    cache_ide(DEV_DISK_DIR "/hdb", MAJOR_HD);
-    cache_ide(DEV_DISK_DIR "/hda", MAJOR_HD);
+    cache_ide(DEV_DISK_DIR "/hdb", MAJOR_IDE);
+    cache_ide(DEV_DISK_DIR "/hda", MAJOR_IDE);
     
     verbose = vsave;
 }
@@ -889,7 +886,7 @@ static int warned = 0, called = 0;
     struct stat st;
     int duplicate = 0, invalid = 0, ret = 0, ntcaution = 0;
     int raidcaution = 0;
-    long codes = 0L;
+    int32_t codes = 0L;
 
 /* called from  raid_setup  &  from  geo_open */
 /* allow only 1 call */
@@ -1170,7 +1167,7 @@ static int warned = 0, called = 0;
                        walk->next = disktab;
                        vm[j].dt = disktab = walk;
 #if BETA_TEST
-                       if (verbose >= 4) printf("Allocated DT entry for device %04X  ptr=%08lx\n", vm[j].device, (long)walk);
+                       if (verbose >= 4) printf("Allocated DT entry for device %04X  ptr=%0*" PRIxPTR "\n", vm[j].device, , PTR_WIDTH, (intptr_t)walk);
 #endif
                    }
 
@@ -1284,7 +1281,7 @@ static int warned = 0, called = 0;
 
 
 
-    if (verbose>=2) printf("device codes (user assigned pf) = %lX\n", codes);
+    if (verbose>=2) printf("device codes (user assigned pf) = %" PRIX32 "\n", codes);
 
 /* mark those BIOS codes that are already used in the disk=/bios= table */
 
@@ -1314,7 +1311,7 @@ static int warned = 0, called = 0;
        }
     }
 
-    if (verbose>=2) printf("device codes (user assigned) = %lX\n", codes);
+    if (verbose>=2) printf("device codes (user assigned) = %" PRIX32 "\n", codes);
 
     for (i=0; i<ndevs; i++) {
        bios = vm[i].bios.probe;
@@ -1327,7 +1324,7 @@ static int warned = 0, called = 0;
        }
     }
 
-    if (verbose>=2) printf("device codes (BIOS assigned) = %lX\n", codes);
+    if (verbose>=2) printf("device codes (BIOS assigned) = %" PRIX32 "\n", codes);
 
     for (bios=i=0; i<ndevs; i++) {
        int j;
@@ -1349,7 +1346,7 @@ static int warned = 0, called = 0;
            walk->next = disktab;
            vm[i].dt = disktab = walk;
 #if BETA_TEST
-           if (verbose >= 4) printf("Allocated DT entry for device %04X  ptr=%08lx\n", vm[i].device, (long)walk);
+           if (verbose >= 4) printf("Allocated DT entry for device %04X  ptr=%0*" PRIxPTR "\n", vm[i].device, PTR_WIDTH, (intptr_t)walk);
 #endif
        }
        j = vm[i].dt->bios = vm[i].bios.actual;
@@ -1379,7 +1376,7 @@ static int warned = 0, called = 0;
        inited = 1;
     }
 
-    if (verbose>=2) printf("device codes (canonical) = %lX\n", codes);
+    if (verbose>=2) printf("device codes (canonical) = %" PRIX32 "\n", codes);
 
     for (bios=8*sizeof(codes)-1; !(codes&(1L<<bios)) && bios>=0; ) bios--;