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 /fs/dlm | |
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 'fs/dlm')
-rw-r--r-- | fs/dlm/netlink.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c index 00d226956264..04042d69573c 100644 --- a/fs/dlm/netlink.c +++ b/fs/dlm/netlink.c | |||
@@ -16,10 +16,7 @@ | |||
16 | static uint32_t dlm_nl_seqnum; | 16 | static uint32_t dlm_nl_seqnum; |
17 | static uint32_t listener_nlportid; | 17 | static uint32_t listener_nlportid; |
18 | 18 | ||
19 | static struct genl_family family = { | 19 | static struct genl_family family; |
20 | .name = DLM_GENL_NAME, | ||
21 | .version = DLM_GENL_VERSION, | ||
22 | }; | ||
23 | 20 | ||
24 | static int prepare_data(u8 cmd, struct sk_buff **skbp, size_t size) | 21 | static int prepare_data(u8 cmd, struct sk_buff **skbp, size_t size) |
25 | { | 22 | { |
@@ -75,9 +72,17 @@ static struct genl_ops dlm_nl_ops[] = { | |||
75 | }, | 72 | }, |
76 | }; | 73 | }; |
77 | 74 | ||
75 | static struct genl_family family = { | ||
76 | .name = DLM_GENL_NAME, | ||
77 | .version = DLM_GENL_VERSION, | ||
78 | .ops = dlm_nl_ops, | ||
79 | .n_ops = ARRAY_SIZE(dlm_nl_ops), | ||
80 | .module = THIS_MODULE, | ||
81 | }; | ||
82 | |||
78 | int __init dlm_netlink_init(void) | 83 | int __init dlm_netlink_init(void) |
79 | { | 84 | { |
80 | return genl_register_family_with_ops(&family, dlm_nl_ops); | 85 | return genl_register_family(&family); |
81 | } | 86 | } |
82 | 87 | ||
83 | void dlm_netlink_exit(void) | 88 | void dlm_netlink_exit(void) |