Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=772a5c3f3bbc7749971a3dd4ff35cd77a9e12201 Commit: 772a5c3f3bbc7749971a3dd4ff35cd77a9e12201 Parent: 03cde46b6bd74672bcb88a2f155aa3e3b6ff4fa1 Author: FUJITA Tomonori <[EMAIL PROTECTED]> AuthorDate: Wed May 16 06:44:34 2007 +0900 Committer: James Bottomley <[EMAIL PROTECTED]> CommitDate: Sat May 26 19:08:50 2007 -0500
[SCSI] sym53c416: 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. Jens Axboe <[EMAIL PROTECTED]> did the for_each_sg cleanup. Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]> Signed-off-by: James Bottomley <[EMAIL PROTECTED]> --- drivers/scsi/sym53c416.c | 44 ++++++++++++++++++-------------------------- 1 files changed, 18 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 2ca9505..92bfaea 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c @@ -332,8 +332,7 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) int i; unsigned long flags = 0; unsigned char status_reg, pio_int_reg, int_reg; - struct scatterlist *sglist; - unsigned int sgcount; + struct scatterlist *sg; unsigned int tot_trans = 0; /* We search the base address of the host adapter which caused the interrupt */ @@ -429,19 +428,15 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) { current_command->SCp.phase = data_out; outb(FLUSH_FIFO, base + COMMAND_REG); - sym53c416_set_transfer_counter(base, current_command->request_bufflen); + sym53c416_set_transfer_counter(base, + scsi_bufflen(current_command)); outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); - if(!current_command->use_sg) - tot_trans = sym53c416_write(base, current_command->request_buffer, current_command->request_bufflen); - else - { - sgcount = current_command->use_sg; - sglist = current_command->request_buffer; - while(sgcount--) - { - tot_trans += sym53c416_write(base, SG_ADDRESS(sglist), sglist->length); - sglist++; - } + + scsi_for_each_sg(current_command, + sg, scsi_sg_count(current_command), i) { + tot_trans += sym53c416_write(base, + SG_ADDRESS(sg), + sg->length); } if(tot_trans < current_command->underflow) printk(KERN_WARNING "sym53c416: Underflow, wrote %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); @@ -455,19 +450,16 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) { current_command->SCp.phase = data_in; outb(FLUSH_FIFO, base + COMMAND_REG); - sym53c416_set_transfer_counter(base, current_command->request_bufflen); + sym53c416_set_transfer_counter(base, + scsi_bufflen(current_command)); + outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); - if(!current_command->use_sg) - tot_trans = sym53c416_read(base, current_command->request_buffer, current_command->request_bufflen); - else - { - sgcount = current_command->use_sg; - sglist = current_command->request_buffer; - while(sgcount--) - { - tot_trans += sym53c416_read(base, SG_ADDRESS(sglist), sglist->length); - sglist++; - } + + scsi_for_each_sg(current_command, + sg, scsi_sg_count(current_command), i) { + tot_trans += sym53c416_read(base, + SG_ADDRESS(sg), + sg->length); } if(tot_trans < current_command->underflow) printk(KERN_WARNING "sym53c416: Underflow, read %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); - 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