]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
libata: bugfix: Remove __le32 in ata_tf_to_fis()
authorMarc Carino <marc.ceeeee@gmail.com>
Sun, 1 Sep 2013 15:59:01 +0000 (08:59 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 3 Sep 2013 14:37:41 +0000 (10:37 -0400)
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>
drivers/ata/libata-core.c

index a044be99841a723e9e2054b2c1d690e916f56012..83b1a9fb2d4418f441c5fa0eb508dbe2819f562c 100644 (file)
@@ -546,8 +546,6 @@ int atapi_cmd_type(u8 opcode)
  */
 void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
 {
-       const __le32 aux = cpu_to_le32(tf->auxiliary);
-
        fis[0] = 0x27;                  /* Register - Host to Device FIS */
        fis[1] = pmp & 0xf;             /* Port multiplier number*/
        if (is_cmd)
@@ -571,10 +569,10 @@ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
        fis[14] = 0;
        fis[15] = tf->ctl;
 
-       fis[16] = aux & 0xff;
-       fis[17] = (aux >> 8) & 0xff;
-       fis[18] = (aux >> 16) & 0xff;
-       fis[19] = (aux >> 24) & 0xff;
+       fis[16] = tf->auxiliary & 0xff;
+       fis[17] = (tf->auxiliary >> 8) & 0xff;
+       fis[18] = (tf->auxiliary >> 16) & 0xff;
+       fis[19] = (tf->auxiliary >> 24) & 0xff;
 }
 
 /**