lib: export bitrev16
Bluetooth will be able to use this. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Dave Young <hidave.darkstar@gmail.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f2eb432715
commit
3527fb326f
|
@ -10,6 +10,7 @@ static inline u8 bitrev8(u8 byte)
|
||||||
return byte_rev_table[byte];
|
return byte_rev_table[byte];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern u16 bitrev16(u16 in);
|
||||||
extern u32 bitrev32(u32 in);
|
extern u32 bitrev32(u32 in);
|
||||||
|
|
||||||
#endif /* _LINUX_BITREV_H */
|
#endif /* _LINUX_BITREV_H */
|
||||||
|
|
|
@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL_GPL(byte_rev_table);
|
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);
|
return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(bitrev16);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitrev32 - reverse the order of bits in a u32 value
|
* bitrev32 - reverse the order of bits in a u32 value
|
||||||
|
|
Loading…
Reference in New Issue