Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: Cleanup for sd in 2.4.19
Date: Thu, 8 Aug 2002 01:58:06 -0400	[thread overview]
Message-ID: <20020808015806.B10154@devserv.devel.redhat.com> (raw)

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);
 

             reply	other threads:[~2002-08-08  5:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08  5:58 Pete Zaitcev [this message]
2002-08-08 14:31 ` Cleanup for sd in 2.4.19 James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020808015806.B10154@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox