aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/bitrev.h1
-rw-r--r--lib/bitrev.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h
index 05e540d6963a..7ffe03f4693d 100644
--- a/include/linux/bitrev.h
+++ b/include/linux/bitrev.h
@@ -10,6 +10,7 @@ static inline u8 bitrev8(u8 byte)
10 return byte_rev_table[byte]; 10 return byte_rev_table[byte];
11} 11}
12 12
13extern u16 bitrev16(u16 in);
13extern u32 bitrev32(u32 in); 14extern u32 bitrev32(u32 in);
14 15
15#endif /* _LINUX_BITREV_H */ 16#endif /* _LINUX_BITREV_H */
diff --git a/lib/bitrev.c b/lib/bitrev.c
index 989aff73f881..3956203456d4 100644
--- a/lib/bitrev.c
+++ b/lib/bitrev.c
@@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
42}; 42};
43EXPORT_SYMBOL_GPL(byte_rev_table); 43EXPORT_SYMBOL_GPL(byte_rev_table);
44 44
45static __always_inline u16 bitrev16(u16 x) 45u16 bitrev16(u16 x)
46{ 46{
47 return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8); 47 return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
48} 48}
49EXPORT_SYMBOL(bitrev16);
49 50
50/** 51/**
51 * bitrev32 - reverse the order of bits in a u32 value 52 * bitrev32 - reverse the order of bits in a u32 value