[PATCH] headers 4/4: Clean up byteorder/{little,big}_endian.h to use __inline__

From: GOTO Masanori
Date: Sun Jun 19 2005 - 23:59:58 EST


This patch cleans up 2.6.12 byteorder/{little,big}_endian.h to use
__inline__ instead of inline because they're included by
asm/byteorder.h which also uses __inline__. In addition, it uses
__BYTEORDER_HAS_U64__ that is similar to include/linux/byteorder/swab.h.

Signed-off-by: GOTO Masanori <gotom@xxxxxxxxxxxx>

Regards,
-- gotom


big_endian.h | 28 ++++++++++++++++------------
little_endian.h | 28 ++++++++++++++++------------
2 files changed, 32 insertions(+), 24 deletions(-)

diff -Nuarp linux-2.6.12/include/linux/byteorder/big_endian.h linux-2.6.12.gotom/include/linux/byteorder/big_endian.h
--- linux-2.6.12/include/linux/byteorder/big_endian.h 2005-06-18 04:48:29.000000000 +0900
+++ linux-2.6.12.gotom/include/linux/byteorder/big_endian.h 2005-06-20 13:11:59.068541152 +0900
@@ -40,51 +40,55 @@
#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))

-static inline __le64 __cpu_to_le64p(const __u64 *p)
+#ifdef __BYTEORDER_HAS_U64__
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
{
return (__force __le64)__swab64p(p);
}
-static inline __u64 __le64_to_cpup(const __le64 *p)
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
{
return __swab64p((__u64 *)p);
}
-static inline __le32 __cpu_to_le32p(const __u32 *p)
+#endif
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
{
return (__force __le32)__swab32p(p);
}
-static inline __u32 __le32_to_cpup(const __le32 *p)
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
{
return __swab32p((__u32 *)p);
}
-static inline __le16 __cpu_to_le16p(const __u16 *p)
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
{
return (__force __le16)__swab16p(p);
}
-static inline __u16 __le16_to_cpup(const __le16 *p)
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
{
return __swab16p((__u16 *)p);
}
-static inline __be64 __cpu_to_be64p(const __u64 *p)
+#ifdef __BYTEORDER_HAS_U64__
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
{
return (__force __be64)*p;
}
-static inline __u64 __be64_to_cpup(const __be64 *p)
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
{
return (__force __u64)*p;
}
-static inline __be32 __cpu_to_be32p(const __u32 *p)
+#endif
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
{
return (__force __be32)*p;
}
-static inline __u32 __be32_to_cpup(const __be32 *p)
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
{
return (__force __u32)*p;
}
-static inline __be16 __cpu_to_be16p(const __u16 *p)
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
{
return (__force __be16)*p;
}
-static inline __u16 __be16_to_cpup(const __be16 *p)
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
{
return (__force __u16)*p;
}
diff -Nuarp linux-2.6.12/include/linux/byteorder/little_endian.h linux-2.6.12.gotom/include/linux/byteorder/little_endian.h
--- linux-2.6.12/include/linux/byteorder/little_endian.h 2005-06-18 04:48:29.000000000 +0900
+++ linux-2.6.12.gotom/include/linux/byteorder/little_endian.h 2005-06-20 13:11:59.066541420 +0900
@@ -40,51 +40,55 @@
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))

-static inline __le64 __cpu_to_le64p(const __u64 *p)
+#ifdef __BYTEORDER_HAS_U64__
+static __inline__ __le64 __cpu_to_le64p(const __u64 *p)
{
return (__force __le64)*p;
}
-static inline __u64 __le64_to_cpup(const __le64 *p)
+static __inline__ __u64 __le64_to_cpup(const __le64 *p)
{
return (__force __u64)*p;
}
-static inline __le32 __cpu_to_le32p(const __u32 *p)
+#endif
+static __inline__ __le32 __cpu_to_le32p(const __u32 *p)
{
return (__force __le32)*p;
}
-static inline __u32 __le32_to_cpup(const __le32 *p)
+static __inline__ __u32 __le32_to_cpup(const __le32 *p)
{
return (__force __u32)*p;
}
-static inline __le16 __cpu_to_le16p(const __u16 *p)
+static __inline__ __le16 __cpu_to_le16p(const __u16 *p)
{
return (__force __le16)*p;
}
-static inline __u16 __le16_to_cpup(const __le16 *p)
+static __inline__ __u16 __le16_to_cpup(const __le16 *p)
{
return (__force __u16)*p;
}
-static inline __be64 __cpu_to_be64p(const __u64 *p)
+#ifdef __BYTEORDER_HAS_U64__
+static __inline__ __be64 __cpu_to_be64p(const __u64 *p)
{
return (__force __be64)__swab64p(p);
}
-static inline __u64 __be64_to_cpup(const __be64 *p)
+static __inline__ __u64 __be64_to_cpup(const __be64 *p)
{
return __swab64p((__u64 *)p);
}
-static inline __be32 __cpu_to_be32p(const __u32 *p)
+#endif
+static __inline__ __be32 __cpu_to_be32p(const __u32 *p)
{
return (__force __be32)__swab32p(p);
}
-static inline __u32 __be32_to_cpup(const __be32 *p)
+static __inline__ __u32 __be32_to_cpup(const __be32 *p)
{
return __swab32p((__u32 *)p);
}
-static inline __be16 __cpu_to_be16p(const __u16 *p)
+static __inline__ __be16 __cpu_to_be16p(const __u16 *p)
{
return (__force __be16)__swab16p(p);
}
-static inline __u16 __be16_to_cpup(const __be16 *p)
+static __inline__ __u16 __be16_to_cpup(const __be16 *p)
{
return __swab16p((__u16 *)p);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/