summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-09-08 04:53:54 +0200
committerDavid S. Miller <davem@davemloft.net>2012-09-09 00:46:30 +0200
commit9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (patch)
tree2a9f9513a13c73cb1196ebe3426389c1140e2888 /include
parentnetlink: kill netlink_set_nonroot (diff)
downloadlinux-9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e.tar.xz
linux-9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e.zip
netlink: hide struct module parameter in netlink_kernel_create
This patch defines netlink_kernel_create as a wrapper function of __netlink_kernel_create to hide the struct module *me parameter (which seems to be THIS_MODULE in all existing netlink subsystems). Suggested by David S. Miller. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netlink.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 8719a4e235a5..cd17dda5a987 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -153,6 +153,7 @@ struct nlattr {
#include <linux/capability.h>
#include <linux/skbuff.h>
+#include <linux/module.h>
#include <net/scm.h>
struct net;
@@ -188,9 +189,15 @@ struct netlink_kernel_cfg {
unsigned int flags;
};
-extern struct sock *netlink_kernel_create(struct net *net, int unit,
- struct module *module,
- struct netlink_kernel_cfg *cfg);
+extern struct sock *__netlink_kernel_create(struct net *net, int unit,
+ struct module *module,
+ struct netlink_kernel_cfg *cfg);
+static inline struct sock *
+netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg)
+{
+ return __netlink_kernel_create(net, unit, THIS_MODULE, cfg);
+}
+
extern void netlink_kernel_release(struct sock *sk);
extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);