patch-2.3.99-pre4 linux/drivers/scsi/sd.c

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

diff -u --recursive --new-file v2.3.99-pre3/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
@@ -120,7 +120,6 @@
 	struct Scsi_Host * host;
 	Scsi_Device * SDev;
 	int diskinfo[4];
-	struct hd_geometry *loc = (struct hd_geometry *) arg;
     
 	SDev = rscsi_disks[DEVICE_NR(dev)].device;
 	/*
@@ -138,6 +137,8 @@
 	switch (cmd) 
 	{
 		case HDIO_GETGEO:   /* Return BIOS disk parameters */
+		{
+			struct hd_geometry *loc = (struct hd_geometry *) arg;
 			if(!loc)
 				return -EINVAL;
 
@@ -164,6 +165,7 @@
 				put_user(sd[SD_PARTITION(inode->i_rdev)].start_sect, &loc->start))
 				return -EFAULT;
 			return 0;
+		}
 		case BLKGETSIZE:   /* Return device size */
 			if (!arg)
 				return -EINVAL;

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