Skip to contentSkip to conversation

SCSI command bytes are copied twice

PATCH New Khalid Aziz 1 participant 1 message Apr 18, 2001 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SCSI command bytes are copied twice

SCSI subsystem needs to copy the SCSI command bytes into a Scsi_Request structure for a SCSI command being issued by one of the higher level drivers before it queues the command up. It does this copy twice. Even though this will cause no more than 12 bytes to be copied twice, this code is still invoked frequently enough to justify not incurring the overhead of a redundant copy. Following patch should fix this.

Thanks,
Khalid

====================================================================
Khalid Aziz Linux Development Laboratory
(970)898-9214 Hewlett-Packard
[email protected] Fort Collins, CO

drivers/scsi/scsi.c +0 -3
@@ -832,9 +832,6 @@
 	SRpnt->sr_allowed = retries;
 	SRpnt->sr_done = done;
 	SRpnt->sr_timeout_per_command = timeout;
-
-	memcpy((void *) SRpnt->sr_cmnd, (const void *) cmnd, 
-	       sizeof(SRpnt->sr_cmnd));
 
 	if (SRpnt->sr_cmd_len == 0)
 		SRpnt->sr_cmd_len = COMMAND_SIZE(SRpnt->sr_cmnd[0]);