]> git.openfabrics.org - ~emulex/compat.git/commitdiff
compat: backport little-endian bitops
authorVladimir Sokolovsky <vlad@mellanox.com>
Fri, 23 Mar 2012 21:34:38 +0000 (23:34 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Fri, 23 Mar 2012 21:34:38 +0000 (23:34 +0200)
[linux-2.6] (master)$ \
        git describe --contains a56560b3b233238e85205d4e8d7bded904ac2306
v2.6.39-rc1~192

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
include/linux/compat-2.6.39.h

index 406f8ebfc9dd75b31c7379438763298f95d6e3b4..961e91c2a15716c308b823790d6a30bf1881e67a 100644 (file)
@@ -164,6 +164,21 @@ int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
 int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
 #endif /* ifndef strict_strtol */
 
+static inline int test_bit_le(int nr, const void *addr)
+{
+       return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void __set_bit_le(int nr, void *addr)
+{
+       __set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
+static inline void __clear_bit_le(int nr, void *addr)
+{
+       __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
 
 #endif /* LINUX_26_39_COMPAT_H */