Hi Jason
I just gave this patch to checkpatch.pl...
total: 6 errors, 763 warnings, 6514 lines checked
It would be good to reduce these numbers.
+static __always_inline void swap_endian(u8 *dst, const u8 *src, u8 bits)
There is a general preference to not force the compile to
inline. Leave it to decide.
quoted hunk ↗ jump to hunk
+#define push(stack, p, len) ({ \
+ if (rcu_access_pointer(p)) { \
+ BUG_ON(len >= 128); \
+ stack[len++] = rcu_dereference_protected(p, lockdep_is_held(lock)); \
+ } \
+ true; \
+})
+#undef push
+
+#define push(p) ({ BUG_ON(len >= 128); stack[len++] = p; })
This is going to lead to bugs, coders thinking push() does one thing,
when it actually does something else. I would suggest making these
helper functions, with useful names.
quoted hunk ↗ jump to hunk
+/* Returns a strong reference to a peer */
+static __always_inline struct wireguard_peer *lookup(struct allowedips_node __rcu *root, u8 bits, const void *be_ip)
+{
+ struct wireguard_peer *peer = NULL;
+ struct allowedips_node *node;
+ u8 ip[16] __aligned(__alignof(u64));
netdev code requires that all local variables are in reverse christmas tree.
Andrew