Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] arcmsr: fix write to device check

Use command->sc_data_direction instead of trying (incorrectly) to
figure it out from the command itself

[jejb: fix up compile failure]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: NickCheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

roel kluin and committed by
James Bottomley
c32e061f 474ffb74

+1 -2
+1 -2
drivers/scsi/arcmsr/arcmsr_hba.c
··· 1171 1171 arcmsr_cdb->msgPages = arccdbsize/0x100 + (arccdbsize % 0x100 ? 1 : 0); 1172 1172 if ( arccdbsize > 256) 1173 1173 arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_SGL_BSIZE; 1174 - if (pcmd->cmnd[0]|WRITE_6 || pcmd->cmnd[0]|WRITE_10 || pcmd->cmnd[0]|WRITE_12 ){ 1174 + if (pcmd->sc_data_direction == DMA_TO_DEVICE) 1175 1175 arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_WRITE; 1176 - } 1177 1176 ccb->arc_cdb_size = arccdbsize; 1178 1177 return SUCCESS; 1179 1178 }