Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1eaf460098e4fd168908af4e6951f921951e916
Commit:     e1eaf460098e4fd168908af4e6951f921951e916
Parent:     9482ef855ef42acb8259f95296b1e93bfb474e74
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 20:27:00 2007 +0900
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sat May 26 19:11:52 2007 -0500

    [SCSI] fdomain: convert to use the data buffer accessors
    
    - remove the unnecessary map_single path.
    
    - convert to use the new accessors for the sg lists and the
    parameters.
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/fdomain.c |   42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index 5d4ea6f..0d1661a 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -1345,16 +1345,15 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void 
*dev_id)
 
 #if ERRORS_ONLY
       if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) {
-        if ((unsigned char)(*((char *)current_SC->request_buffer+2)) & 0x0f) {
+             char *buf = scsi_sglist(current_SC);
+        if ((unsigned char)(*(buf + 2)) & 0x0f) {
            unsigned char key;
            unsigned char code;
            unsigned char qualifier;
 
-           key = (unsigned char)(*((char *)current_SC->request_buffer + 2))
-                 & 0x0f;
-           code = (unsigned char)(*((char *)current_SC->request_buffer + 12));
-           qualifier = (unsigned char)(*((char *)current_SC->request_buffer
-                                         + 13));
+           key = (unsigned char)(*(buf + 2)) & 0x0f;
+           code = (unsigned char)(*(buf + 12));
+           qualifier = (unsigned char)(*(buf + 13));
 
            if (key != UNIT_ATTENTION
                && !(key == NOT_READY
@@ -1405,8 +1404,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,
    printk( "queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n",
           SCpnt->target,
           *(unsigned char *)SCpnt->cmnd,
-          SCpnt->use_sg,
-          SCpnt->request_bufflen );
+          scsi_sg_count(SCpnt),
+          scsi_bufflen(SCpnt));
 #endif
 
    fdomain_make_bus_idle();
@@ -1416,20 +1415,19 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,
 
    /* Initialize static data */
 
-   if (current_SC->use_sg) {
-      current_SC->SCp.buffer =
-           (struct scatterlist *)current_SC->request_buffer;
-      current_SC->SCp.ptr              = 
page_address(current_SC->SCp.buffer->page) + current_SC->SCp.buffer->offset;
-      current_SC->SCp.this_residual    = current_SC->SCp.buffer->length;
-      current_SC->SCp.buffers_residual = current_SC->use_sg - 1;
+   if (scsi_sg_count(current_SC)) {
+          current_SC->SCp.buffer = scsi_sglist(current_SC);
+          current_SC->SCp.ptr = page_address(current_SC->SCp.buffer->page)
+                  + current_SC->SCp.buffer->offset;
+          current_SC->SCp.this_residual    = current_SC->SCp.buffer->length;
+          current_SC->SCp.buffers_residual = scsi_sg_count(current_SC) - 1;
    } else {
-      current_SC->SCp.ptr              = (char *)current_SC->request_buffer;
-      current_SC->SCp.this_residual    = current_SC->request_bufflen;
-      current_SC->SCp.buffer           = NULL;
-      current_SC->SCp.buffers_residual = 0;
+          current_SC->SCp.ptr              = 0;
+          current_SC->SCp.this_residual    = 0;
+          current_SC->SCp.buffer           = NULL;
+          current_SC->SCp.buffers_residual = 0;
    }
-        
-   
+
    current_SC->SCp.Status              = 0;
    current_SC->SCp.Message             = 0;
    current_SC->SCp.have_data_in        = 0;
@@ -1472,8 +1470,8 @@ static void print_info(struct scsi_cmnd *SCpnt)
           SCpnt->SCp.phase,
           SCpnt->device->id,
           *(unsigned char *)SCpnt->cmnd,
-          SCpnt->use_sg,
-          SCpnt->request_bufflen );
+          scsi_sg_count(SCpnt),
+          scsi_bufflen(SCpnt));
    printk( "sent_command = %d, have_data_in = %d, timeout = %d\n",
           SCpnt->SCp.sent_command,
           SCpnt->SCp.have_data_in,
-
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