]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/uapi/linux/swab.h
Merge tag 'tty-5.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[linux.git] / include / uapi / linux / swab.h
index 23cd84868cc3bd8907994664c82407ca49a1d8d9..7272f85d6d6ab5e24dd806e7f88760eaafcd7326 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/types.h>
 #include <linux/compiler.h>
+#include <asm/bitsperlong.h>
 #include <asm/swab.h>
 
 /*
@@ -132,6 +133,15 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val)
        __fswab64(x))
 #endif
 
+static __always_inline unsigned long __swab(const unsigned long y)
+{
+#if __BITS_PER_LONG == 64
+       return __swab64(y);
+#else /* __BITS_PER_LONG == 32 */
+       return __swab32(y);
+#endif
+}
+
 /**
  * __swahw32 - return a word-swapped 32-bit value
  * @x: value to wordswap