Commit c0918aed authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] qla2xxx: remove unnecessary command direction determination

On Tuesday, June 22, 2004 12:07 AM, Arjan van de Ven wrote:
> On Tue, 2004-06-22 at 07:49, Andrew Vasquez wrote:
>
> > diff -Nru a/drivers/scsi/qla2xxx/qla_iocb.c
> b/drivers/scsi/qla2xxx/qla_iocb.c
> > --- a/drivers/scsi/qla2xxx/qla_iocb.c	2004-06-21 15:36:37 -07:00
> > +++ b/drivers/scsi/qla2xxx/qla_iocb.c	2004-06-21 15:36:37 -07:00 @@
> >  	-43,7 +43,7 @@ else if (cmd->sc_data_direction ==
> >  	DMA_FROM_DEVICE)  		cflags = CF_READ; else {
> > -		switch (cmd->data_cmnd[0]) {
> > +		switch (cmd->cmnd[0]) {
> >  		case WRITE_6:
> >  		case WRITE_10:
> >  		case WRITE_12:
>
> this sounds wrong.
>

Yes, it is _wrong_!   This code is baggage left behind from earlier
drivers when we were 'asked' to work around certain applications'
inability to properly construct commands.

> Is there any reason qlogic drivers can't use/trust the midlayer
> instead of doing qla2x00_get_cmd_direction() to reverse engineer to
> direction ??

Sure.  Especially considering an earlier thread:

	http://marc.theaimsgroup.com/?t=108727983000002&r=1&w=2Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent a44502f6
......@@ -42,28 +42,6 @@ qla2x00_get_cmd_direction(struct scsi_cmnd *cmd)
cflags = CF_WRITE;
else if (cmd->sc_data_direction == DMA_FROM_DEVICE)
cflags = CF_READ;
else {
switch (cmd->cmnd[0]) {
case WRITE_6:
case WRITE_10:
case WRITE_12:
case WRITE_BUFFER:
case WRITE_LONG:
case WRITE_SAME:
case WRITE_VERIFY:
case WRITE_VERIFY_12:
case FORMAT_UNIT:
case SEND_VOLUME_TAG:
case MODE_SELECT:
case SEND_DIAGNOSTIC:
case MODE_SELECT_10:
cflags = CF_WRITE;
break;
default:
cflags = CF_READ;
break;
}
}
return (cflags);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment