aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/routingtable.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-08-01 22:47:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-08-02 14:40:43 +0200
commit107735eaea0f48c1f5bfc0a6ca82f1879a850b98 (patch)
treed7197eb1feba29dd90b5363c20ef340d15ff4ec2 /src/routingtable.c
parentblake2s: satisfy sparse (diff)
downloadwireguard-monolithic-historical-107735eaea0f48c1f5bfc0a6ca82f1879a850b98.tar.xz
wireguard-monolithic-historical-107735eaea0f48c1f5bfc0a6ca82f1879a850b98.zip
routingtable: unbloat BUG()
Really isn't necessary.
Diffstat (limited to '')
-rw-r--r--src/routingtable.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/routingtable.c b/src/routingtable.c
index a6abb61..8db3efe 100644
--- a/src/routingtable.c
+++ b/src/routingtable.c
@@ -119,18 +119,17 @@ static void walk_remove_by_peer(struct routing_table_node __rcu **top, struct wi
#undef deref
#undef push
-static inline unsigned int fls128(u64 a, u64 b)
+static __always_inline unsigned int fls128(u64 a, u64 b)
{
return a ? fls64(a) + 64 : fls64(b);
}
-static inline u8 common_bits(const struct routing_table_node *node, const u8 *key, u8 bits)
+static __always_inline u8 common_bits(const struct routing_table_node *node, const u8 *key, u8 bits)
{
if (bits == 32)
return 32 - fls(be32_to_cpu(*(const __be32 *)node->bits ^ *(const __be32 *)key));
else if (bits == 128)
return 128 - fls128(be64_to_cpu(*(const __be64 *)&node->bits[0] ^ *(const __be64 *)&key[0]), be64_to_cpu(*(const __be64 *)&node->bits[8] ^ *(const __be64 *)&key[8]));
- BUG();
return 0;
}