tree 29b32fbb32911f3aecf347675b7283b6269e7fda
parent c0698f2f6e4839ce9463ce731c892993215ea067
author [EMAIL PROTECTED] <[EMAIL PROTECTED]> Tue, 19 Apr 2005 11:16:57 -0700
committer Greg KH <[EMAIL PROTECTED]> Tue, 19 Apr 2005 11:16:57 -0700

[PATCH] w1: real fix for big endian machines.

Real fix for big endian machines - crc must be calculated
using little endian byte order.

Signed-off-by: Evgeniy Polyakov <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 w1/w1.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Index: drivers/w1/w1.c
===================================================================
--- b05fc8a950ace937460212e996441e4c05a227f6/drivers/w1/w1.c  (mode:100644 
sha1:fd630cec0e7915bcdbc620d49b098002b18bbc0c)
+++ 29b32fbb32911f3aecf347675b7283b6269e7fda/drivers/w1/w1.c  (mode:100644 
sha1:8d7821899cc10440137299c7254ee4750c416d8d)
@@ -522,10 +522,11 @@
                slave_count++;
        }
 
-               if (slave_count == dev->slave_count && rn ) {
-                       tmp = cpu_to_le64(rn);
-                       if(((rn >> 56) & 0xff) == w1_calc_crc8((u8 *)&tmp, 7))
-                               w1_attach_slave_device(dev, (struct w1_reg_num 
*) &rn);
+       rn = cpu_to_le64(rn);
+
+       if (slave_count == dev->slave_count &&
+               rn && ((le64_to_cpu(rn) >> 56) & 0xff) == w1_calc_crc8((u8 
*)&rn, 7)) {
+               w1_attach_slave_device(dev, tmp);
        }
                        
        atomic_dec(&dev->refcnt);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to