From: Albert Lee Date: Sun, 9 Oct 2005 13:47:31 +0000 (-0400) Subject: [libata irq-pio] reorganize "buf + offset" in ata_pio_sector() X-Git-Tag: v2.6.18-rc1~1079^2~98^2~13^2~95 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=083958d313f886dc7d00522f2972f90f55c40041;p=karo-tx-linux.git [libata irq-pio] reorganize "buf + offset" in ata_pio_sector() and __atapi_pio_bytes() - relocate DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read"); - buf + offset, buf - offset tidy up Signed-off-by: Albert Lee --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f89312654791..35ee35e176c0 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -2760,15 +2760,15 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) page = nth_page(page, (offset >> PAGE_SHIFT)); offset %= PAGE_SIZE; - local_irq_save(flags); - buf = kmap_atomic(page, KM_IRQ0) + offset; - DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read"); + local_irq_save(flags); + buf = kmap_atomic(page, KM_IRQ0); + /* do the actual data transfer */ - ata_data_xfer(ap, buf, ATA_SECT_SIZE, do_write); + ata_data_xfer(ap, buf + offset, ATA_SECT_SIZE, do_write); - kunmap_atomic(buf - offset, KM_IRQ0); + kunmap_atomic(buf, KM_IRQ0); local_irq_restore(flags); qc->cursect++; @@ -2952,15 +2952,15 @@ next_sg: /* don't cross page boundaries */ count = min(count, (unsigned int)PAGE_SIZE - offset); - local_irq_save(flags); - buf = kmap_atomic(page, KM_IRQ0) + offset; - DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read"); + local_irq_save(flags); + buf = kmap_atomic(page, KM_IRQ0); + /* do the actual data transfer */ - ata_data_xfer(ap, buf, count, do_write); + ata_data_xfer(ap, buf + offset, count, do_write); - kunmap_atomic(buf - offset, KM_IRQ0); + kunmap_atomic(buf, KM_IRQ0); local_irq_restore(flags); bytes -= count;