Avoid the need for explicit initialization during runtime
(Patrick McHardy's review)
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/ipset/ip_set.h>
-static struct list_head ip_set_type_list; /* all registered set types */
+static LIST_HEAD(ip_set_type_list); /* all registered set types */
static DEFINE_MUTEX(ip_set_type_mutex); /* protects ip_set_type_list */
static struct ip_set **ip_set_list; /* all individual sets */
return -ENOMEM;
}
- INIT_LIST_HEAD(&ip_set_type_list);
-
ret = nfnetlink_subsys_register(&ip_set_netlink_subsys);
if (ret != 0) {
pr_err("ip_set: cannot register with nfnetlink.");