提交 8523ff45 编写于 作者: J johnpol@2ka.mipt.ru 提交者: Greg KH

[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: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c0698f2f
......@@ -522,10 +522,11 @@ void w1_slave_found(unsigned long data, u64 rn)
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册