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>
This commit is contained in:
Johannes Berg
2016-10-24 14:40:03 +02:00
committed by David S. Miller
parent a07ea4d994
commit 489111e5c2
37 changed files with 415 additions and 338 deletions

View File

@@ -1215,14 +1215,6 @@ send:
return err;
}
static struct genl_family tipc_genl_compat_family = {
.name = TIPC_GENL_NAME,
.version = TIPC_GENL_VERSION,
.hdrsize = TIPC_GENL_HDRLEN,
.maxattr = 0,
.netnsok = true,
};
static struct genl_ops tipc_genl_compat_ops[] = {
{
.cmd = TIPC_GENL_CMD,
@@ -1230,12 +1222,22 @@ static struct genl_ops tipc_genl_compat_ops[] = {
},
};
static struct genl_family tipc_genl_compat_family = {
.name = TIPC_GENL_NAME,
.version = TIPC_GENL_VERSION,
.hdrsize = TIPC_GENL_HDRLEN,
.maxattr = 0,
.netnsok = true,
.module = THIS_MODULE,
.ops = tipc_genl_compat_ops,
.n_ops = ARRAY_SIZE(tipc_genl_compat_ops),
};
int tipc_netlink_compat_start(void)
{
int res;
res = genl_register_family_with_ops(&tipc_genl_compat_family,
tipc_genl_compat_ops);
res = genl_register_family(&tipc_genl_compat_family);
if (res) {
pr_err("Failed to register legacy compat interface\n");
return res;