]> err.no Git - linux-2.6/commit
endian: Always evaluate arguments.
authorDavid Miller <davem@davemloft.net>
Fri, 25 Jul 2008 06:38:31 +0000 (23:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Jul 2008 16:28:09 +0000 (09:28 -0700)
commit3d6f4a20cc287a8980c6186624834cf10a70752b
tree851e6f595fe7a03ca626287be24961517cf47709
parent43de804df8d6002059bf4af4522fa9273a19b8aa
endian: Always evaluate arguments.

Changeset 7fa897b91a3ea0f16c2873b869d7a0eef05acff4 ("ide: trivial sparse
annotations") created an IDE bootup regression on big-endian systems.

In drivers/ide/ide-iops.c, function ide_fixstring() we now have the
loop:

for (p = end ; p != s;)
be16_to_cpus((u16 *)(p -= 2));

which will never terminate on big-endian because in such
a configuration be16_to_cpus() evaluates to "do { } while (0)"

Therefore, always evaluate the arguments to nop endian transformation
operations.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/byteorder/big_endian.h
include/linux/byteorder/little_endian.h