Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com>
Cc: Finn Thain <fth...@telegraphics.com.au>
Cc: Michael Schmitz <schmitz...@gmail.com>
---
 drivers/scsi/ncr53c8xx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 5b93ed8..b9c489a 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -4286,13 +4286,12 @@ static int ncr_queue_command (struct ncb *np, struct 
scsi_cmnd *cmd)
                direction = DMA_NONE;
 
        /*
-       **      If data direction is BIDIRECTIONAL, speculate FROM_DEVICE
+       **      For bidi commands, speculate FROM_DEVICE
        **      but prepare alternate pointers for TO_DEVICE in case 
        **      of our speculation will be just wrong.
        **      SCRIPTS will swap values if needed.
        */
        switch(direction) {
-       case DMA_BIDIRECTIONAL:
        case DMA_TO_DEVICE:
                goalp = NCB_SCRIPT_PHYS (np, data_out2) + 8;
                if (segments <= MAX_SCATTERL)
@@ -4301,7 +4300,7 @@ static int ncr_queue_command (struct ncb *np, struct 
scsi_cmnd *cmd)
                        lastp = NCB_SCRIPTH_PHYS (np, hdata_out2);
                        lastp -= (segments - MAX_SCATTERL) * 16;
                }
-               if (direction != DMA_BIDIRECTIONAL)
+               if (!scsi_bidi_cmd(cmd))
                        break;
                cp->phys.header.wgoalp  = cpu_to_scr(goalp);
                cp->phys.header.wlastp  = cpu_to_scr(lastp);
@@ -4328,7 +4327,7 @@ static int ncr_queue_command (struct ncb *np, struct 
scsi_cmnd *cmd)
        cp->phys.header.lastp = cpu_to_scr(lastp);
        cp->phys.header.goalp = cpu_to_scr(goalp);
 
-       if (direction == DMA_BIDIRECTIONAL)
+       if (scsi_bidi_cmd(cmd))
                cp->phys.header.savep = 
                        cpu_to_scr(NCB_SCRIPTH_PHYS (np, data_io));
        else
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to