Linux SCSI subsystem development
 help / color / mirror / Atom feed
* Cleanup for sd in 2.4.19
@ 2002-08-08  5:58 Pete Zaitcev
  2002-08-08 14:31 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Pete Zaitcev @ 2002-08-08  5:58 UTC (permalink / raw)
  To: linux-scsi

A pure cleanup here. I know that something that works should not
be fixed, but cheesh. There are limits to everything. I cannot wait
until James destroys all this crap, it's just too painful to read.

-- Pete

--- linux-2.4.18-7.94/drivers/scsi/sd.c	Wed Aug  7 14:28:03 2002
+++ linux-2.4.18-7.94-s31/drivers/scsi/sd.c	Wed Aug  7 22:22:02 2002
@@ -119,7 +119,7 @@
 static int check_scsidisk_media_change(kdev_t);
 static int fop_revalidate_scsidisk(kdev_t);
 
-static int sd_init_onedisk(int);
+static void sd_init_onedisk(int);
 
 
 static int sd_init(void);
@@ -718,7 +718,6 @@
 {
 	int retval;
 	int target;
-	int flag = 0;
 	Scsi_Device * SDev;
 
 	target = DEVICE_NR(full_dev);
@@ -774,12 +773,11 @@
 	rscsi_disks[target].ready = 1;	/* FLOPTICAL */
 
 	retval = SDev->changed;
-	if (!flag)
-		SDev->changed = 0;
+	SDev->changed = 0;
 	return retval;
 }
 
-static int sd_init_onedisk(int i)
+static void sd_init_onedisk(int i)
 {
 	unsigned char cmd[10];
 	char nbuff[6];
@@ -799,7 +797,7 @@
 	 * of the other niceties.
 	 */
 	if (rscsi_disks[i].device->online == FALSE)
-		return i;
+		return;
 
 	/*
 	 * We need to retry the READ_CAPACITY because a UNIT_ATTENTION is
@@ -810,14 +808,14 @@
 	SRpnt = scsi_allocate_request(rscsi_disks[i].device);
 	if (!SRpnt) {
 		printk(KERN_WARNING "(sd_init_onedisk:) Request allocation failure.\n");
-		return i;
+		return;
 	}
 
 	buffer = (unsigned char *) scsi_malloc(512);
 	if (!buffer) {
 		printk(KERN_WARNING "(sd_init_onedisk:) Memory allocation failure.\n");
 		scsi_release_request(SRpnt);
-		return i;
+		return;
 	}
 
 	spintime = 0;
@@ -1095,7 +1093,7 @@
 	SRpnt = NULL;
 
 	scsi_free(buffer, 512);
-	return i;
+	return;
 }
 
 /*
@@ -1346,7 +1344,6 @@
 #define ALLOW_REVALIDATE rscsi_disks[target].device->allow_revalidate
 #define USAGE rscsi_disks[target].device->access_count
 #define CAPACITY rscsi_disks[target].capacity
-#define MAYBE_REINIT  sd_init_onedisk(target)
 
 /* This routine is called to flush all partitions and partition tables
  * for a changed scsi disk, and then re-read the new partition table.
@@ -1393,10 +1390,7 @@
 			sd_blocksizes[index] = 1024;
 	}
 
-#ifdef MAYBE_REINIT
-	MAYBE_REINIT;
-#endif
-
+	sd_init_onedisk(target);
 	grok_partitions(&SD_GENDISK(target), target % SCSI_DISKS_PER_MAJOR,
 			1<<4, CAPACITY);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-08 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-08  5:58 Cleanup for sd in 2.4.19 Pete Zaitcev
2002-08-08 14:31 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox