patch-1.3.74 linux/drivers/block/ide.c

Next file: linux/drivers/char/ftape/Makefile
Previous file: linux/drivers/block/floppy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.73/linux/drivers/block/ide.c linux/drivers/block/ide.c
@@ -524,7 +524,7 @@
  */
 static void init_gendisk (ide_hwif_t *hwif)
 {
-	struct gendisk *gd, **gdp;
+	struct gendisk *gd;
 	unsigned int unit, units, minors;
 	int *bs;
 
@@ -556,9 +556,8 @@
 	gd->init	= ide_geninit;		/* initialization function */
 	gd->real_devices= hwif;			/* ptr to internal data */
 
-	for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next)) ;
-	gd->next = NULL;			/* link to tail of list */
-	hwif->gd = *gdp = gd;
+	gd->next = gendisk_head;		/* link new major into list */
+	hwif->gd = gendisk_head = gd;
 }
 
 static void do_reset1 (ide_drive_t *, int);		/* needed below */
@@ -2900,11 +2899,11 @@
 		}
 	}
 	/*
-	 * Check for serialization with ide1.
-	 * This code depends on us having already taken care of ide1.
+	 * Check for serialization with ide0.
+	 * This code depends on us having already taken care of ide0.
 	 */
-	if (hwif->serialized && hwif->index == 0 && ide_hwifs[1].present)
-		hwgroup = ide_hwifs[1].hwgroup;
+	if (hwif->index == 1 && ide_hwifs[0].serialized && ide_hwifs[0].present)
+		hwgroup = ide_hwifs[0].hwgroup;
 	/*
 	 * If this is the first interface in a group,
 	 * then we need to create the hwgroup structure

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this