aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 14:23:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 14:23:17 -0400
commit6adc74b7d03c06a8e15d51fe33c3d924ada9271a (patch)
tree84b934ed223e0c4aa4f6233b38eea0f8e50f00ef /drivers/ata/libata-sff.c
parentc9059598ea8981d02356eead3188bf7fa4d717b8 (diff)
parent517d3cc15b36392e518abab6bacbb72089658313 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata] ata_piix: Enable parallel scan sata_nv: use hardreset only for post-boot probing [libata] ahci: Restore SB600 SATA controller 64 bit DMA ata_piix: Remove stale comment ata_piix: Turn on hotplugging support for older chips ahci: misc cleanups for EM stuff [libata] get rid of ATA_MAX_QUEUE loop in ata_qc_complete_multiple() v2 sata_sil: enable 32-bit PIO sata_sx4: speed up ECC initialization libata-sff: avoid byte swapping in ata_sff_data_xfer() [libata] ahci: use less error-prone array initializers
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index bb18415d3d63..bbbb1fab1755 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -727,17 +727,23 @@ unsigned int ata_sff_data_xfer(struct ata_device *dev, unsigned char *buf,
727 else 727 else
728 iowrite16_rep(data_addr, buf, words); 728 iowrite16_rep(data_addr, buf, words);
729 729
730 /* Transfer trailing 1 byte, if any. */ 730 /* Transfer trailing byte, if any. */
731 if (unlikely(buflen & 0x01)) { 731 if (unlikely(buflen & 0x01)) {
732 __le16 align_buf[1] = { 0 }; 732 unsigned char pad[2];
733 unsigned char *trailing_buf = buf + buflen - 1;
734 733
734 /* Point buf to the tail of buffer */
735 buf += buflen - 1;
736
737 /*
738 * Use io*16_rep() accessors here as well to avoid pointlessly
739 * swapping bytes to and fro on the big endian machines...
740 */
735 if (rw == READ) { 741 if (rw == READ) {
736 align_buf[0] = cpu_to_le16(ioread16(data_addr)); 742 ioread16_rep(data_addr, pad, 1);
737 memcpy(trailing_buf, align_buf, 1); 743 *buf = pad[0];
738 } else { 744 } else {
739 memcpy(align_buf, trailing_buf, 1); 745 pad[0] = *buf;
740 iowrite16(le16_to_cpu(align_buf[0]), data_addr); 746 iowrite16_rep(data_addr, pad, 1);
741 } 747 }
742 words++; 748 words++;
743 } 749 }