]> granicus.if.org Git - ipset/commitdiff
Use static LIST_HEAD() for ip_set_type_list
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 20 Jan 2011 09:58:43 +0000 (10:58 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 20 Jan 2011 09:58:43 +0000 (10:58 +0100)
Avoid the need for explicit initialization during runtime
(Patrick McHardy's review)

kernel/ip_set_core.c

index ebd37fa5baab6b1e8cd5753a6ea0652adc95175d..e38c43e8445213c90f89e3883fbcb3b12631b534 100644 (file)
@@ -23,7 +23,7 @@
 #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 */
@@ -1521,8 +1521,6 @@ ip_set_init(void)
                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.");