* 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
* Re: Cleanup for sd in 2.4.19
2002-08-08 5:58 Cleanup for sd in 2.4.19 Pete Zaitcev
@ 2002-08-08 14:31 ` James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2002-08-08 14:31 UTC (permalink / raw)
To: Pete Zaitcev; +Cc: linux-scsi
zaitcev@redhat.com said:
> 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.
I didn't sign up to clean out the Augean Stables on my own. I'm trying to
rationalise the substance. Beautifying the structure when not part of a
substantive change (however painful it may be to the eye) isn't high on my
list of priorities. And 2.4 is nowhere; I'm working on 2.5 almost exclusively.
The patch looks fine to me: send it off to Marcelo---he's been wanting to get
into SCSI coding anyway, so he might be interested in helping out on this type
of work.
Oh, and if the same problem persists in 2.5, I'll take patches (or you can
toss them over the wall at Doug Leadford).
James
^ 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