Re: [patch] cciss: Fix cciss SCSI rescan code to better notice device changes.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Friday, September 19, 2008 - 5:19 pm

On Thu, 18 Sep 2008 15:07:44 -0500
scameron@beardog.cca.cpqcorp.net wrote:


y'know, it would be a lot simpler to just do

	*sd = *device;

a few lines up, before assigning sd->bus/target/lun.

Putting these:

@@ -66,6 +66,10 @@ struct cciss_scsi_dev_t {
 	int devtype;
 	int bus, target, lun;		/* as presented to the OS */
 	unsigned char scsi3addr[8];	/* as presented to the HW */
+	unsigned char device_id[16];	/* from inquiry pg. 0x83 */
+	unsigned char vendor[8];	/* bytes 8-15 of inquiry data */
+	unsigned char model[16];	/* bytes 16-31 of inquiry data */
+	unsigned char revision[4];	/* bytes 32-35 of inquiry data */
 };

into a separate nested structure might make that neater still.


`struct cciss_scsi_dev_t' should have been named `struct cciss_scsi_dev',
but I guess I'm a bit late to that party.


didn't cciss_scsi_add_entry() just do that?  I didn't look too closely,
so maybe it didn't, and we're taking two copies for some reason. 
Please double-check?



The caller ignores the error return from this function.  I guess that's
reasonable, and kzalloc() will have spewed a bit warning anyway..



That's kcalloc().


Quite a bit of duplication.  Perhaps a helper function is needed somewhere.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] cciss: Fix cciss SCSI rescan code to better no ..., Andrew Morton, (Fri Sep 19, 5:19 pm)