public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: compat: Substitute compat code for netlink constification
@ 2016-10-18 21:21 Linus Lüssing
  2016-10-18 21:24 ` Linus Lüssing
  2016-10-18 21:28 ` Sven Eckelmann
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Lüssing @ 2016-10-18 21:21 UTC (permalink / raw)
  To: b.a.t.m.a.n

Substitutes the compat-patches approach for the netlink const changes to
the prefered way of using compat-includes.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
 compat-include/net/genetlink.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
index 72a8991..b195b47 100644
--- a/compat-include/net/genetlink.h
+++ b/compat-include/net/genetlink.h
@@ -28,6 +28,15 @@
 
 #include <linux/export.h>
 
+/* multicast groups */
+enum __batadv_netlink_multicast_groups {
+	__BATADV_NL_MCGRP_TPMETER,
+};
+
+static struct genl_multicast_group __batadv_netlink_mcgrps[] = {
+	[__BATADV_NL_MCGRP_TPMETER] = { .name = BATADV_NL_MCAST_GROUP_TPMETER },
+};
+
 struct batadv_genl_family {
 	/* data handled by the actual kernel */
 	struct genl_family family;
@@ -140,12 +149,14 @@ static inline int batadv_genl_register_family(struct genl_family *family)
 static inline int
 batadv_genl_register_family_with_ops_grps(struct genl_family *family,
 					  struct genl_ops *ops, size_t n_ops,
-					  struct genl_multicast_group *mcgrps,
+					  const struct genl_multicast_group *mcgrps,
 					  size_t n_mcgrps)
 {
+	BUILD_BUG_ON(ARRAY_SIZE(__batadv_netlink_mcgrps) != n_mcgrps);
+
 	family->ops = ops;
 	family->n_ops = n_ops;
-	family->mcgrps = mcgrps;
+	family->mcgrps = __batadv_netlink_mcgrps;
 	family->n_mcgrps = n_mcgrps;
 	family->module = THIS_MODULE;
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-20 18:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 21:21 [B.A.T.M.A.N.] [PATCH] batman-adv: compat: Substitute compat code for netlink constification Linus Lüssing
2016-10-18 21:24 ` Linus Lüssing
2016-10-18 21:28 ` Sven Eckelmann
2016-10-18 23:22   ` Linus Lüssing
2016-10-19  6:31     ` Sven Eckelmann
2016-10-20 18:33       ` Linus Lüssing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox