diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-10-24 08:40:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-27 16:16:09 -0400 |
commit | 489111e5c25b93be80340c3113d71903d7c82136 (patch) | |
tree | bf1af9c989ee4cd1decbfcbfe0633d7f563f5c83 /drivers/net/gtp.c | |
parent | a07ea4d9941af5a0c6f0be2a71b51ac9c083c5e5 (diff) |
genetlink: statically initialize families
Instead of providing macros/inline functions to initialize
the families, make all users initialize them statically and
get rid of the macros.
This reduces the kernel code size by about 1.6k on x86-64
(with allyesconfig).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gtp.c')
-rw-r--r-- | drivers/net/gtp.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index f66737ba1299..0604fd78f826 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c | |||
@@ -1094,13 +1094,7 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) | |||
1094 | return 0; | 1094 | return 0; |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static struct genl_family gtp_genl_family = { | 1097 | static struct genl_family gtp_genl_family; |
1098 | .name = "gtp", | ||
1099 | .version = 0, | ||
1100 | .hdrsize = 0, | ||
1101 | .maxattr = GTPA_MAX, | ||
1102 | .netnsok = true, | ||
1103 | }; | ||
1104 | 1098 | ||
1105 | static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, | 1099 | static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, |
1106 | u32 type, struct pdp_ctx *pctx) | 1100 | u32 type, struct pdp_ctx *pctx) |
@@ -1296,6 +1290,17 @@ static const struct genl_ops gtp_genl_ops[] = { | |||
1296 | }, | 1290 | }, |
1297 | }; | 1291 | }; |
1298 | 1292 | ||
1293 | static struct genl_family gtp_genl_family = { | ||
1294 | .name = "gtp", | ||
1295 | .version = 0, | ||
1296 | .hdrsize = 0, | ||
1297 | .maxattr = GTPA_MAX, | ||
1298 | .netnsok = true, | ||
1299 | .module = THIS_MODULE, | ||
1300 | .ops = gtp_genl_ops, | ||
1301 | .n_ops = ARRAY_SIZE(gtp_genl_ops), | ||
1302 | }; | ||
1303 | |||
1299 | static int __net_init gtp_net_init(struct net *net) | 1304 | static int __net_init gtp_net_init(struct net *net) |
1300 | { | 1305 | { |
1301 | struct gtp_net *gn = net_generic(net, gtp_net_id); | 1306 | struct gtp_net *gn = net_generic(net, gtp_net_id); |
@@ -1335,7 +1340,7 @@ static int __init gtp_init(void) | |||
1335 | if (err < 0) | 1340 | if (err < 0) |
1336 | goto error_out; | 1341 | goto error_out; |
1337 | 1342 | ||
1338 | err = genl_register_family_with_ops(>p_genl_family, gtp_genl_ops); | 1343 | err = genl_register_family(>p_genl_family); |
1339 | if (err < 0) | 1344 | if (err < 0) |
1340 | goto unreg_rtnl_link; | 1345 | goto unreg_rtnl_link; |
1341 | 1346 | ||