Skip to contentSkip to conversation

lib: export bitrev16

PATCH In review Harvey Harrison 3 participants 3 messages Jun 3, 2008 – Jun 4, 2008

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

PATCH 1/2 lib: export bitrev16

Bluetooth will be able to use this.

---
 include/linux/bitrev.h |    1 +
 lib/bitrev.c           |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
include/linux/bitrev.h +1 -0
index 05e540d..7ffe03f 100644
@@ -10,6 +10,7 @@ static inline u8 bitrev8(u8 byte)
 	return byte_rev_table[byte];
 }
 
+extern u16 bitrev16(u16 in);
 extern u32 bitrev32(u32 in);
 
 #endif /* _LINUX_BITREV_H */
lib/bitrev.c +2 -1
index 989aff7..3956203 100644
@@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
 };
 EXPORT_SYMBOL_GPL(byte_rev_table);
 
-static __always_inline u16 bitrev16(u16 x)
+u16 bitrev16(u16 x)
 {
 	return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
 }
+EXPORT_SYMBOL(bitrev16);
 
 /**
  * bitrev32 - reverse the order of bits in a u32 value
Signature · 1 line
1.5.6.rc0.336.ge5422
#2 lore raw
In reply to Harvey Harrison

lib/bitrev.c const u8 byte_rev_table[256] = { · line 49

Quoted 12 lines
lib/bitrev.c +2 -1
@@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
 };
 EXPORT_SYMBOL_GPL(byte_rev_table);
 
-static __always_inline u16 bitrev16(u16 x)
+u16 bitrev16(u16 x)
 {
       return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
 }
+EXPORT_SYMBOL(bitrev16);

How about just moving bitrev16() from lib/bitrev.c to include/linux/bitrev.h with s/__always_inline/inline/ rather than making it export symbol?