common: Get rid of [le|be]64_to_cpu macros
They operate on integers, not floats. Floating point requires different handling.
This commit is contained in:
parent
d591d9738b
commit
3bf185e60c
|
@ -61,27 +61,21 @@
|
|||
#define PPD( ... ) do { fprintf(stderr, "PPD: " __VA_ARGS__ ); sleep(1); } while (0)
|
||||
|
||||
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
#define le64_to_cpu(__x) __x
|
||||
#define le32_to_cpu(__x) __x
|
||||
#define le16_to_cpu(__x) __x
|
||||
#define le32_to_cpu(__x) __x
|
||||
#define be16_to_cpu(__x) __builtin_bswap16(__x)
|
||||
#define be32_to_cpu(__x) __builtin_bswap32(__x)
|
||||
#define be64_to_cpu(__x) __builtin_bswap64(__x)
|
||||
#else
|
||||
#define le16_to_cpu(__x) __builtin_bswap16(__x)
|
||||
#define le32_to_cpu(__x) __builtin_bswap32(__x)
|
||||
#define le64_to_cpu(__x) __builtin_bswap64(__x)
|
||||
#define be64_to_cpu(__x) __x
|
||||
#define be32_to_cpu(__x) __x
|
||||
#define be16_to_cpu(__x) __x
|
||||
#endif
|
||||
|
||||
#define cpu_to_le16 le16_to_cpu
|
||||
#define cpu_to_le32 le32_to_cpu
|
||||
#define cpu_to_le64 le64_to_cpu
|
||||
#define cpu_to_be16 be16_to_cpu
|
||||
#define cpu_to_be32 be32_to_cpu
|
||||
#define cpu_to_be64 be64_to_cpu
|
||||
|
||||
/* To cheat the compiler */
|
||||
#define UNUSED(expr) do { (void)(expr); } while (0)
|
||||
|
|
|
@ -225,27 +225,21 @@ static void LeadEdgeCorrection(void);
|
|||
//-------------------------------------------------------------------------
|
||||
// Endian Manipulation macros
|
||||
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
#define le64_to_cpu(__x) __x
|
||||
#define le32_to_cpu(__x) __x
|
||||
#define le16_to_cpu(__x) __x
|
||||
#define le32_to_cpu(__x) __x
|
||||
#define be16_to_cpu(__x) __builtin_bswap16(__x)
|
||||
#define be32_to_cpu(__x) __builtin_bswap32(__x)
|
||||
#define be64_to_cpu(__x) __builtin_bswap64(__x)
|
||||
#else
|
||||
#define le16_to_cpu(__x) __builtin_bswap16(__x)
|
||||
#define le32_to_cpu(__x) __builtin_bswap32(__x)
|
||||
#define le64_to_cpu(__x) __builtin_bswap64(__x)
|
||||
#define be64_to_cpu(__x) __x
|
||||
#define be32_to_cpu(__x) __x
|
||||
#define be16_to_cpu(__x) __x
|
||||
#define be32_to_cpu(__x) __x
|
||||
#endif
|
||||
|
||||
#define cpu_to_le16 le16_to_cpu
|
||||
#define cpu_to_le32 le32_to_cpu
|
||||
#define cpu_to_be16 be16_to_cpu
|
||||
#define cpu_to_be32 be32_to_cpu
|
||||
#define cpu_to_le64 le64_to_cpu
|
||||
#define cpu_to_be64 be64_to_cpu
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Data declarations
|
||||
|
|
Loading…
Reference in a new issue