• a.llano@usyscom.com's avatar
    [PATCH] Fix 1-Wire Dallas in bigendian machines · 4ea5e988
    a.llano@usyscom.com authored
    I've been testing the 1-Wire Dallas in a bigendian machine (through a GPIO)
    and I've found some problems that can easily addressed with the provided
    patch.  (inline at the end of the message).
    
    I have a question about the implementation of w1_smem.
    In the line 90 of drivers/w1/w1_smem.c.
      for (i = 0; i < 9; ++i)
         count += sprintf(buf + count, "%02x ", ((u8 *)&sl->reg_num)[i]);
    I don't see why this loop is execute 9 times when the provided reg_num
    is 8 bytes long. I don't understand the purpose of the last byte.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    4ea5e988
w1.c 18.9 KB