diff options
author | Michael Buesch <mb@bu3sch.de> | 2006-10-10 14:33:26 -0700 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-10-11 03:56:33 -0400 |
commit | 6f62768344e46520ae585f3e201c9d3e497b028f (patch) | |
tree | a11d61c6c351b04d09c575a6a83db814af968930 /lib/ts_kmp.c | |
parent | 12f417ee95bf98cd3e42d2a771f7c6d360159b9d (diff) | |
download | kernel_samsung_smdk4412-6f62768344e46520ae585f3e201c9d3e497b028f.zip kernel_samsung_smdk4412-6f62768344e46520ae585f3e201c9d3e497b028f.tar.gz kernel_samsung_smdk4412-6f62768344e46520ae585f3e201c9d3e497b028f.tar.bz2 |
[PATCH] b44: fix eeprom endianess issue
This fixes eeprom read on big-endian architectures.
readw returns the data in CPU order. With cpu_to_le16 we convert it to little
endian, because "ptr" is a pointer to a _byte_ arrray. See the cast above. A
byte array is little endian.
The bug is:
Reading u16 values with readw, casting them into an u8 array and accessing
this u8 array as an u8 (byte) array. The correct fix is to swap the
CPU-ordering value returned by readw into little endian, as the u8 array is
little endian.
This compiles to nothing on little endian hardware (so it does not change b44
code on LE hardware), but _fixes_ code on BE hardware.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'lib/ts_kmp.c')
0 files changed, 0 insertions, 0 deletions