lkml.org 
[lkml]   [2008]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 01/24] byteorder: update arch override definitions
From
Date
Linus prefers the actual function name be used as the guard.

Makes it greppable for all places that define/use the __arch
version.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
Andrew, an update for byteorder-add-a-new-include-linux-swabh-to-define-byteswapping-functions.patch

Linus expressed his dislike for the HAVE_ARCH_ format as it becomes ungreppable to
see who actually uses it.

New versions of all the arch wire-ups as well, with acks for avr32 and mips from
arch maintainers.

include/linux/swab.h | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/linux/swab.h b/include/linux/swab.h
index 8f955b2..270d5c2 100644
--- a/include/linux/swab.h
+++ b/include/linux/swab.h
@@ -45,9 +45,9 @@

static inline __attribute_const__ __u16 ___swab16(__u16 val)
{
-#ifdef HAVE_ARCH_SWAB16
+#ifdef __arch_swab16
return __arch_swab16(val);
-#elif defined(HAVE_ARCH_SWAB16P)
+#elif defined(__arch_swab16p)
return __arch_swab16p(&val);
#else
return __const_swab16(val);
@@ -56,9 +56,9 @@ static inline __attribute_const__ __u16 ___swab16(__u16 val)

static inline __attribute_const__ __u32 ___swab32(__u32 val)
{
-#ifdef HAVE_ARCH_SWAB32
+#ifdef __arch_swab32
return __arch_swab32(val);
-#elif defined(HAVE_ARCH_SWAB32P)
+#elif defined(__arch_swab32p)
return __arch_swab32p(&val);
#else
return __const_swab32(val);
@@ -67,9 +67,9 @@ static inline __attribute_const__ __u32 ___swab32(__u32 val)

static inline __attribute_const__ __u64 ___swab64(__u64 val)
{
-#ifdef HAVE_ARCH_SWAB64
+#ifdef __arch_swab64
return __arch_swab64(val);
-#elif defined(HAVE_ARCH_SWAB64P)
+#elif defined(__arch_swab64p)
return __arch_swab64p(&val);
#elif defined(__SWAB_64_THRU_32__)
__u32 h = val >> 32;
@@ -82,9 +82,9 @@ static inline __attribute_const__ __u64 ___swab64(__u64 val)

static inline __attribute_const__ __u32 ___swahw32(__u32 val)
{
-#ifdef HAVE_ARCH_SWAHW32
+#ifdef __arch_swahw32
return __arch_swahw32(val);
-#elif defined(HAVE_ARCH_SWAHW32P)
+#elif defined(__arch_swahw32p)
return __arch_swahw32p(&val);
#else
return __const_swahw32(val);
@@ -93,9 +93,9 @@ static inline __attribute_const__ __u32 ___swahw32(__u32 val)

static inline __attribute_const__ __u32 ___swahb32(__u32 val)
{
-#ifdef HAVE_ARCH_SWAHB32
+#ifdef __arch_swahb32
return __arch_swahb32(val);
-#elif defined(HAVE_ARCH_SWAHB32P)
+#elif defined(__arch_swahb32p)
return __arch_swahb32p(&val);
#else
return __const_swahb32(val);
@@ -157,7 +157,7 @@ static inline __attribute_const__ __u32 ___swahb32(__u32 val)
*/
static inline __u16 __swab16p(const __u16 *p)
{
-#ifdef HAVE_ARCH_SWAB16P
+#ifdef __arch_swab16p
return __arch_swab16p(p);
#else
return __swab16(*p);
@@ -170,7 +170,7 @@ static inline __u16 __swab16p(const __u16 *p)
*/
static inline __u32 __swab32p(const __u32 *p)
{
-#ifdef HAVE_ARCH_SWAB32P
+#ifdef __arch_swab32p
return __arch_swab32p(p);
#else
return __swab32(*p);
@@ -183,7 +183,7 @@ static inline __u32 __swab32p(const __u32 *p)
*/
static inline __u64 __swab64p(const __u64 *p)
{
-#ifdef HAVE_ARCH_SWAB64P
+#ifdef __arch_swab64p
return __arch_swab64p(p);
#else
return __swab64(*p);
@@ -198,7 +198,7 @@ static inline __u64 __swab64p(const __u64 *p)
*/
static inline __u32 __swahw32p(const __u32 *p)
{
-#ifdef HAVE_ARCH_SWAHW32P
+#ifdef __arch_swahw32p
return __arch_swahw32p(p);
#else
return __swahw32(*p);
@@ -213,7 +213,7 @@ static inline __u32 __swahw32p(const __u32 *p)
*/
static inline __u32 __swahb32p(const __u32 *p)
{
-#ifdef HAVE_ARCH_SWAHB32P
+#ifdef __arch_swahb32p
return __arch_swahb32p(p);
#else
return __swahb32(*p);
@@ -226,7 +226,7 @@ static inline __u32 __swahb32p(const __u32 *p)
*/
static inline void __swab16s(__u16 *p)
{
-#ifdef HAVE_ARCH_SWAB16S
+#ifdef __arch_swab16s
__arch_swab16s(p);
#else
*p = __swab16p(p);
@@ -238,7 +238,7 @@ static inline void __swab16s(__u16 *p)
*/
static inline void __swab32s(__u32 *p)
{
-#ifdef HAVE_ARCH_SWAB32S
+#ifdef __arch_swab32s
__arch_swab32s(p);
#else
*p = __swab32p(p);
@@ -251,7 +251,7 @@ static inline void __swab32s(__u32 *p)
*/
static inline void __swab64s(__u64 *p)
{
-#ifdef HAVE_ARCH_SWAB64S
+#ifdef __arch_swab64s
__arch_swab64s(p);
#else
*p = __swab64p(p);
@@ -266,7 +266,7 @@ static inline void __swab64s(__u64 *p)
*/
static inline void __swahw32s(__u32 *p)
{
-#ifdef HAVE_ARCH_SWAHW32S
+#ifdef __arch_swahw32s
__arch_swahw32s(p);
#else
*p = __swahw32p(p);
@@ -281,7 +281,7 @@ static inline void __swahw32s(__u32 *p)
*/
static inline void __swahb32s(__u32 *p)
{
-#ifdef HAVE_ARCH_SWAHB32S
+#ifdef __arch_swahb32s
__arch_swahb32s(p);
#else
*p = __swahb32p(p);
--
1.6.0.rc1.154.ge3fc



\
 
 \ /
  Last update: 2008-07-30 02:57    [W:0.062 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site