From: Vladimir Sokolovsky Date: Fri, 23 Mar 2012 21:34:38 +0000 (+0200) Subject: compat: backport little-endian bitops X-Git-Tag: compat-2012-07-02~15 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=aad708a3417e1b3b6edb8653ae7c30e289a50a2d;p=~tnikolova%2Fcompat%2F.git compat: backport little-endian bitops [linux-2.6] (master)$ \ git describe --contains a56560b3b233238e85205d4e8d7bded904ac2306 v2.6.39-rc1~192 Signed-off-by: Vladimir Sokolovsky --- diff --git a/include/linux/compat-2.6.39.h b/include/linux/compat-2.6.39.h index 406f8eb..961e91c 100644 --- a/include/linux/compat-2.6.39.h +++ b/include/linux/compat-2.6.39.h @@ -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 */