endian: Always evaluate arguments.
Changeset 7fa897b91a
("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>
This commit is contained in:
parent
43de804df8
commit
3d6f4a20cc
2 changed files with 12 additions and 12 deletions
|
@ -94,12 +94,12 @@ static inline __u16 __be16_to_cpup(const __be16 *p)
|
|||
#define __le32_to_cpus(x) __swab32s((x))
|
||||
#define __cpu_to_le16s(x) __swab16s((x))
|
||||
#define __le16_to_cpus(x) __swab16s((x))
|
||||
#define __cpu_to_be64s(x) do {} while (0)
|
||||
#define __be64_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be32s(x) do {} while (0)
|
||||
#define __be32_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be16s(x) do {} while (0)
|
||||
#define __be16_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_be64s(x) do { (void)(x); } while (0)
|
||||
#define __be64_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be32s(x) do { (void)(x); } while (0)
|
||||
#define __be32_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be16s(x) do { (void)(x); } while (0)
|
||||
#define __be16_to_cpus(x) do { (void)(x); } while (0)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/byteorder/generic.h>
|
||||
|
|
|
@ -88,12 +88,12 @@ static inline __u16 __be16_to_cpup(const __be16 *p)
|
|||
{
|
||||
return __swab16p((__u16 *)p);
|
||||
}
|
||||
#define __cpu_to_le64s(x) do {} while (0)
|
||||
#define __le64_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_le32s(x) do {} while (0)
|
||||
#define __le32_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_le16s(x) do {} while (0)
|
||||
#define __le16_to_cpus(x) do {} while (0)
|
||||
#define __cpu_to_le64s(x) do { (void)(x); } while (0)
|
||||
#define __le64_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_le32s(x) do { (void)(x); } while (0)
|
||||
#define __le32_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_le16s(x) do { (void)(x); } while (0)
|
||||
#define __le16_to_cpus(x) do { (void)(x); } while (0)
|
||||
#define __cpu_to_be64s(x) __swab64s((x))
|
||||
#define __be64_to_cpus(x) __swab64s((x))
|
||||
#define __cpu_to_be32s(x) __swab32s((x))
|
||||
|
|
Loading…
Reference in a new issue