diff options
author | Marc Carino <marc.ceeeee@gmail.com> | 2013-09-01 11:59:01 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-09-03 10:37:41 -0400 |
commit | 86a565e61bcb9574bae3b622799682fef2d855bb (patch) | |
tree | 7e6b44cba78f54779388ebb1c6a1b78138cb5807 | |
parent | 03f7b802b876904971f23f00f562061309e95e08 (diff) |
libata: bugfix: Remove __le32 in ata_tf_to_fis()
The endianness attribute on the 'aux' local variable is wrong, and can
lead to wrong endianness on big-endian machines,
Signed-off-by: Marc Carino <marc.ceeeee@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | drivers/ata/libata-core.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a044be99841a..83b1a9fb2d44 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -546,8 +546,6 @@ int atapi_cmd_type(u8 opcode) | |||
546 | */ | 546 | */ |
547 | void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) | 547 | void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) |
548 | { | 548 | { |
549 | const __le32 aux = cpu_to_le32(tf->auxiliary); | ||
550 | |||
551 | fis[0] = 0x27; /* Register - Host to Device FIS */ | 549 | fis[0] = 0x27; /* Register - Host to Device FIS */ |
552 | fis[1] = pmp & 0xf; /* Port multiplier number*/ | 550 | fis[1] = pmp & 0xf; /* Port multiplier number*/ |
553 | if (is_cmd) | 551 | if (is_cmd) |
@@ -571,10 +569,10 @@ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) | |||
571 | fis[14] = 0; | 569 | fis[14] = 0; |
572 | fis[15] = tf->ctl; | 570 | fis[15] = tf->ctl; |
573 | 571 | ||
574 | fis[16] = aux & 0xff; | 572 | fis[16] = tf->auxiliary & 0xff; |
575 | fis[17] = (aux >> 8) & 0xff; | 573 | fis[17] = (tf->auxiliary >> 8) & 0xff; |
576 | fis[18] = (aux >> 16) & 0xff; | 574 | fis[18] = (tf->auxiliary >> 16) & 0xff; |
577 | fis[19] = (aux >> 24) & 0xff; | 575 | fis[19] = (tf->auxiliary >> 24) & 0xff; |
578 | } | 576 | } |
579 | 577 | ||
580 | /** | 578 | /** |