]> git.baikalelectronics.ru Git - kernel.git/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)
commit0b886fc8d3acf7ae275cdcb2895858cc8f33962a
tree851e6f595fe7a03ca626287be24961517cf47709
parent915e2b502c67cb3533535e4ed4fd02cb4e633987
endian: Always evaluate arguments.

Changeset 01430c72b47ddc6f7d6d861cdcbcd316886c0080 ("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