patch-2.3.29 linux/drivers/scsi/scsicam.c

Next file: linux/drivers/scsi/seagate.c
Previous file: linux/drivers/scsi/scsi_proc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.28/linux/drivers/scsi/scsicam.c linux/drivers/scsi/scsicam.c
@@ -42,18 +42,20 @@
 		       kdev_t dev,	/* Device major, minor */
 		  int *ip /* Heads, sectors, cylinders in that order */ )
 {
-
 	struct buffer_head *bh;
 	int ret_code;
 	int size = disk->capacity;
 	unsigned long temp_cyl;
 
+	int ma = MAJOR(dev);
+	int mi = (MINOR(dev) & ~0xf);
+
 	int block = 1024; 
 
-	if(blksize_size[MAJOR(dev)])
-		block = blksize_size[MAJOR(dev)][MINOR(dev)];
+	if(blksize_size[ma])
+		block = blksize_size[ma][mi];
 		
-	if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev) & ~0xf), 0, block)))
+	if (!(bh = bread(MKDEV(ma,mi), 0, block)))
 		return -1;
 
 	/* try to infer mapping from partition table */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)