diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-25 11:20:49 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-25 13:07:01 +0100 |
commit | f377ba101a729d1cb6038b196ee8a4fd6ee1ea75 (patch) | |
tree | 22c377d114b05ed8c582503284a192260ce064e6 /src | |
parent | 6c58b00a5a30d783048dc5e1f7aa8961d739e740 (diff) |
allowedips: do not use __always_inline
DaveM doth forbid.
Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/allowedips.c | 18 |
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)); |