]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/byteorder/generic.h
Merge branch 'timers/range-hrtimers' into v28-range-hrtimers-for-linus-v2
[linux-2.6-omap-h63xx.git] / include / linux / byteorder / generic.h
index 3dc715b025002d90935cac7e204e16a197060b63..0846e6b931cefc9ea9baedfe9bfc93300e4c474b 100644 (file)
  *
  */
 
-
-#if defined(__KERNEL__)
-/*
- * inside the kernel, we can use nicknames;
- * outside of it, we must avoid POSIX namespace pollution...
- */
 #define cpu_to_le64 __cpu_to_le64
 #define le64_to_cpu __le64_to_cpu
 #define cpu_to_le32 __cpu_to_le32
 #define htons(x) ___htons(x)
 #define ntohs(x) ___ntohs(x)
 
-#endif /* KERNEL */
+static inline void le16_add_cpu(__le16 *var, u16 val)
+{
+       *var = cpu_to_le16(le16_to_cpu(*var) + val);
+}
+
+static inline void le32_add_cpu(__le32 *var, u32 val)
+{
+       *var = cpu_to_le32(le32_to_cpu(*var) + val);
+}
+
+static inline void le64_add_cpu(__le64 *var, u64 val)
+{
+       *var = cpu_to_le64(le64_to_cpu(*var) + val);
+}
+
+static inline void be16_add_cpu(__be16 *var, u16 val)
+{
+       *var = cpu_to_be16(be16_to_cpu(*var) + val);
+}
+
+static inline void be32_add_cpu(__be32 *var, u32 val)
+{
+       *var = cpu_to_be32(be32_to_cpu(*var) + val);
+}
+
+static inline void be64_add_cpu(__be64 *var, u64 val)
+{
+       *var = cpu_to_be64(be64_to_cpu(*var) + val);
+}
 
 #endif /* _LINUX_BYTEORDER_GENERIC_H */