Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e10b8c3f5f23188e065b1845ba732570eca007fe
Commit:     e10b8c3f5f23188e065b1845ba732570eca007fe
Parent:     d2a84f47899d1efc24fa610696f7b793692279c7
Author:     Boaz Harrosh <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 17:46:12 2007 +0200
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:38 2007 -0400

    libata-scsi: Remove !use_sg code paths
    
         This is a minimal patch needed to remove use of !use_sg
         but it is not a complete clean up of the !use_sg paths.
         Libata-core still has the qc->flags & ATA_QCFLAG_SG
         and !qc->n_elem code paths. Perhaps an ata maintainer
         would have a go at it.
    
         - TODO: further cleanup of qc->flags & ATA_QCFLAG_SG
           and !qc->n_elem code paths in libata-core
         - TODO: Use scsi_dma_{map,unmap} where applicable.
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-scsi.c |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f0f586b..598ef10 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -450,13 +450,8 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct 
ata_device *dev,
                qc->scsicmd = cmd;
                qc->scsidone = done;
 
-               if (cmd->use_sg) {
-                       qc->__sg = (struct scatterlist *) cmd->request_buffer;
-                       qc->n_elem = cmd->use_sg;
-               } else if (cmd->request_bufflen) {
-                       qc->__sg = &qc->sgent;
-                       qc->n_elem = 1;
-               }
+               qc->__sg = (struct scatterlist *) cmd->request_buffer;
+               qc->n_elem = cmd->use_sg;
        } else {
                cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
                done(cmd);
@@ -1504,11 +1499,7 @@ static int ata_scsi_translate(struct ata_device *dev, 
struct scsi_cmnd *cmd,
                        goto err_did;
                }
 
-               if (cmd->use_sg)
-                       ata_sg_init(qc, cmd->request_buffer, cmd->use_sg);
-               else
-                       ata_sg_init_one(qc, cmd->request_buffer,
-                                       cmd->request_bufflen);
+               ata_sg_init(qc, cmd->request_buffer, cmd->use_sg);
 
                qc->dma_dir = cmd->sc_data_direction;
        }
@@ -1562,15 +1553,14 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
        u8 *buf;
        unsigned int buflen;
 
-       if (cmd->use_sg) {
-               struct scatterlist *sg;
+       struct scatterlist *sg = (struct scatterlist *) cmd->request_buffer;
 
-               sg = (struct scatterlist *) cmd->request_buffer;
+       if (sg) {
                buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
                buflen = sg->length;
        } else {
-               buf = cmd->request_buffer;
-               buflen = cmd->request_bufflen;
+               buf = NULL;
+               buflen = 0;
        }
 
        *buf_out = buf;
@@ -1590,12 +1580,9 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
 
 static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
 {
-       if (cmd->use_sg) {
-               struct scatterlist *sg;
-
-               sg = (struct scatterlist *) cmd->request_buffer;
+       struct scatterlist *sg = (struct scatterlist *) cmd->request_buffer;
+       if (sg)
                kunmap_atomic(buf - sg->offset, KM_IRQ0);
-       }
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to