Skip to contentSkip to conversation

lib: expose bitrev16 as an inline

PATCH New Harvey Harrison 1 participant 1 message Jun 4, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 lib: expose bitrev16 as an inline

Bluetooth will be able to use this.

---
Marcel, I have changed the patch somewhat so haven't added your ack to it or to patch 2/2

 include/linux/bitrev.h |    5 +++++
 lib/bitrev.c           |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
include/linux/bitrev.h +5 -0
index 05e540d..5c21f62 100644
@@ -10,6 +10,11 @@ static inline u8 bitrev8(u8 byte)
 	return byte_rev_table[byte];
 }
 
+static inline u16 bitrev16(u16 x)
+{
+	return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
+}
+
 extern u32 bitrev32(u32 in);
 
 #endif /* _LINUX_BITREV_H */
lib/bitrev.c +0 -5
index 989aff7..88bdbee 100644
@@ -42,11 +42,6 @@ const u8 byte_rev_table[256] = {
 };
 EXPORT_SYMBOL_GPL(byte_rev_table);
 
-static __always_inline u16 bitrev16(u16 x)
-{
-	return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
-}
-
 /**
  * bitrev32 - reverse the order of bits in a u32 value
  * @x: value to be bit-reversed
Signature · 1 line
1.5.6.rc1.257.gba91d