From: Alan Stern Date: Fri, 10 Oct 2008 20:03:20 +0000 (-0400) Subject: [SCSI] sd: remove command-size switching code X-Git-Tag: v2.6.28-rc1~11^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4c9b736080056ae3ba81dcf2ac418193c57dbb1;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git [SCSI] sd: remove command-size switching code This patch (as1138) removes from sd.c some old code for switching from 10-byte commands to 6-byte commands. This code is redundant -- the switching for READ and WRITE is already handled in scsi_io_completion() and the switching for MODE SENSE is already handled in scsi_mode_sense(). (There is no comparable switch for MODE SELECT, but I doubt one is needed.) Furthermore the other handlers do a better job; they check for appropriate ASC and ASCQ values before blindly switching the size. The code in sd.c is known to cause problems with some devices by switching when it shouldn't. Signed-off-by: Alan Stern Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 55e6ed4..7e22aa7 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1084,15 +1084,6 @@ static int sd_done(struct scsi_cmnd *SCpnt) scsi_print_sense("sd", SCpnt); good_bytes = sd_completed_bytes(SCpnt); } - if (!scsi_device_protection(SCpnt->device) && - SCpnt->device->use_10_for_rw && - (SCpnt->cmnd[0] == READ_10 || - SCpnt->cmnd[0] == WRITE_10)) - SCpnt->device->use_10_for_rw = 0; - if (SCpnt->device->use_10_for_ms && - (SCpnt->cmnd[0] == MODE_SENSE_10 || - SCpnt->cmnd[0] == MODE_SELECT_10)) - SCpnt->device->use_10_for_ms = 0; break; default: break;