Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 083958d3 authored by Albert Lee's avatar Albert Lee Committed by Jeff Garzik
Browse files

[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: default avatarAlbert Lee <albertcc@tw.ibm.com>
parent 7282aa4b
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -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 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
	/* 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;