Skip to content

Commit d4c9b73

Browse files
AlanSternJames Bottomley
authored and
James Bottomley
committed
[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 <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 36a5292 commit d4c9b73

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

drivers/scsi/sd.c

-9
Original file line numberDiff line numberDiff line change
@@ -1084,15 +1084,6 @@ static int sd_done(struct scsi_cmnd *SCpnt)
10841084
scsi_print_sense("sd", SCpnt);
10851085
good_bytes = sd_completed_bytes(SCpnt);
10861086
}
1087-
if (!scsi_device_protection(SCpnt->device) &&
1088-
SCpnt->device->use_10_for_rw &&
1089-
(SCpnt->cmnd[0] == READ_10 ||
1090-
SCpnt->cmnd[0] == WRITE_10))
1091-
SCpnt->device->use_10_for_rw = 0;
1092-
if (SCpnt->device->use_10_for_ms &&
1093-
(SCpnt->cmnd[0] == MODE_SENSE_10 ||
1094-
SCpnt->cmnd[0] == MODE_SELECT_10))
1095-
SCpnt->device->use_10_for_ms = 0;
10961087
break;
10971088
default:
10981089
break;

0 commit comments

Comments
 (0)