aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-25 11:20:49 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-25 13:07:01 +0100
commita7703482c6f0f85623704f71f31e5a5cd15a322a (patch)
treee12f48778817a6639c24861e3d452d9595a31ccd
parentpeerlookup: rename from hashtables (diff)
downloadWireGuard-a7703482c6f0f85623704f71f31e5a5cd15a322a.tar.xz
WireGuard-a7703482c6f0f85623704f71f31e5a5cd15a322a.zip
allowedips: do not use __always_inline
DaveM doth forbid. Suggested-by: David Miller <davem@davemloft.net>
-rw-r--r--src/allowedips.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/allowedips.c b/src/allowedips.c
index 592501e..f175944 100644
--- a/src/allowedips.c
+++ b/src/allowedips.c
@@ -6,7 +6,7 @@
#include "allowedips.h"
#include "peer.h"
-static __always_inline void swap_endian(u8 *dst, const u8 *src, u8 bits)
+static void swap_endian(u8 *dst, const u8 *src, u8 bits)
{
if (bits == 32) {
*(u32 *)dst = be32_to_cpu(*(const __be32 *)src);
@@ -130,8 +130,8 @@ static unsigned int fls128(u64 a, u64 b)
return a ? fls64(a) + 64U : fls64(b);
}
-static __always_inline u8 common_bits(const struct allowedips_node *node,
- const u8 *key, u8 bits)
+static u8 common_bits(const struct allowedips_node *node, const u8 *key,
+ u8 bits)
{
if (bits == 32)
return 32U - fls(*(const u32 *)node->bits ^ *(const u32 *)key);
@@ -142,8 +142,8 @@ static __always_inline u8 common_bits(const struct allowedips_node *node,
return 0;
}
-static __always_inline bool prefix_matches(const struct allowedips_node *node,
- const u8 *key, u8 bits)
+static bool prefix_matches(const struct allowedips_node *node, const u8 *key,
+ u8 bits)
{
/* This could be much faster if it actually just compared the common
* bits properly, by precomputing a mask bswap(~0 << (32 - cidr)), and
@@ -154,8 +154,8 @@ static __always_inline bool prefix_matches(const struct allowedips_node *node,
return common_bits(node, key, bits) >= node->cidr;
}
-static __always_inline struct allowedips_node *
-find_node(struct allowedips_node *trie, u8 bits, const u8 *key)
+static struct allowedips_node *find_node(struct allowedips_node *trie, u8 bits,
+ const u8 *key)
{
struct allowedips_node *node = trie, *found = NULL;
@@ -170,8 +170,8 @@ find_node(struct allowedips_node *trie, u8 bits, const u8 *key)
}
/* Returns a strong reference to a peer */
-static __always_inline struct wg_peer *
-lookup(struct allowedips_node __rcu *root, u8 bits, const void *be_ip)
+static struct wg_peer *lookup(struct allowedips_node __rcu *root, u8 bits,
+ const void *be_ip)
{
/* Aligned so it can be passed to fls/fls64 */
u8 ip[16] __aligned(__alignof(u64));