summaryrefslogtreecommitdiffhomepage
path: root/src
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
commitcdec0cf1e107a6cc6b66a345f4f00d6e25a901bd (patch)
treedbaf275a037cb25fe5444aa11461965dff290227 /src
parentfbfcdf28f98d54073b9387fda061894920649e26 (diff)
routingtable: unbloat BUG()
Really isn't necessary. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-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;
}