diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-11-19 09:19:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-19 16:39:05 -0500 |
commit | c53ed7423619b4e8108914a9f31b426dd58ad591 (patch) | |
tree | 03a469a7f00d99ff73bf947b5306369bfaff18f5 | |
parent | dbde497966804e63a38fdedc1e3815e77097efc2 (diff) |
genetlink: only pass array to genl_register_family_with_ops()
As suggested by David Miller, make genl_register_family_with_ops()
a macro and pass only the array, evaluating ARRAY_SIZE() in the
macro, this is a little safer.
The openvswitch has some indirection, assing ops/n_ops directly in
that code. This might ultimately just assign the pointers in the
family initializations, saving the struct genl_family_and_ops and
code (once mcast groups are handled differently.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/team/team.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 3 | ||||
-rw-r--r-- | fs/dlm/netlink.c | 10 | ||||
-rw-r--r-- | include/linux/genl_magic_func.h | 3 | ||||
-rw-r--r-- | include/net/genetlink.h | 8 | ||||
-rw-r--r-- | kernel/taskstats.c | 3 | ||||
-rw-r--r-- | net/core/drop_monitor.c | 3 | ||||
-rw-r--r-- | net/hsr/hsr_netlink.c | 3 | ||||
-rw-r--r-- | net/ieee802154/netlink.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_metrics.c | 3 | ||||
-rw-r--r-- | net/irda/irnetlink.c | 3 | ||||
-rw-r--r-- | net/l2tp/l2tp_netlink.c | 7 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_mgmt.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 2 | ||||
-rw-r--r-- | net/netlink/genetlink.c | 14 | ||||
-rw-r--r-- | net/nfc/netlink.c | 3 | ||||
-rw-r--r-- | net/openvswitch/datapath.c | 5 | ||||
-rw-r--r-- | net/tipc/netlink.c | 11 | ||||
-rw-r--r-- | net/wimax/stack.c | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 3 |
22 files changed, 47 insertions, 53 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 6390254beb7d..f55758b0840e 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -2699,8 +2699,7 @@ static int team_nl_init(void) | |||
2699 | { | 2699 | { |
2700 | int err; | 2700 | int err; |
2701 | 2701 | ||
2702 | err = genl_register_family_with_ops(&team_nl_family, team_nl_ops, | 2702 | err = genl_register_family_with_ops(&team_nl_family, team_nl_ops); |
2703 | ARRAY_SIZE(team_nl_ops)); | ||
2704 | if (err) | 2703 | if (err) |
2705 | return err; | 2704 | return err; |
2706 | 2705 | ||
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index cfc3fda79a2d..9df7bc91a26f 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -2148,8 +2148,7 @@ static int hwsim_init_netlink(void) | |||
2148 | 2148 | ||
2149 | printk(KERN_INFO "mac80211_hwsim: initializing netlink\n"); | 2149 | printk(KERN_INFO "mac80211_hwsim: initializing netlink\n"); |
2150 | 2150 | ||
2151 | rc = genl_register_family_with_ops(&hwsim_genl_family, | 2151 | rc = genl_register_family_with_ops(&hwsim_genl_family, hwsim_ops); |
2152 | hwsim_ops, ARRAY_SIZE(hwsim_ops)); | ||
2153 | if (rc) | 2152 | if (rc) |
2154 | goto failure; | 2153 | goto failure; |
2155 | 2154 | ||
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c index 60a327863b11..e7cfbaf8d0e2 100644 --- a/fs/dlm/netlink.c +++ b/fs/dlm/netlink.c | |||
@@ -74,14 +74,16 @@ static int user_cmd(struct sk_buff *skb, struct genl_info *info) | |||
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | static struct genl_ops dlm_nl_ops = { | 77 | static struct genl_ops dlm_nl_ops[] = { |
78 | .cmd = DLM_CMD_HELLO, | 78 | { |
79 | .doit = user_cmd, | 79 | .cmd = DLM_CMD_HELLO, |
80 | .doit = user_cmd, | ||
81 | }, | ||
80 | }; | 82 | }; |
81 | 83 | ||
82 | int __init dlm_netlink_init(void) | 84 | int __init dlm_netlink_init(void) |
83 | { | 85 | { |
84 | return genl_register_family_with_ops(&family, &dlm_nl_ops, 1); | 86 | return genl_register_family_with_ops(&family, dlm_nl_ops); |
85 | } | 87 | } |
86 | 88 | ||
87 | void dlm_netlink_exit(void) | 89 | void dlm_netlink_exit(void) |
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index 023bc346b877..47086030ab31 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h | |||
@@ -293,8 +293,7 @@ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ | |||
293 | 293 | ||
294 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) | 294 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) |
295 | { | 295 | { |
296 | int err = genl_register_family_with_ops(&ZZZ_genl_family, | 296 | int err = genl_register_family_with_ops(&ZZZ_genl_family, ZZZ_genl_ops); |
297 | ZZZ_genl_ops, ARRAY_SIZE(ZZZ_genl_ops)); | ||
298 | if (err) | 297 | if (err) |
299 | return err; | 298 | return err; |
300 | #undef GENL_mc_group | 299 | #undef GENL_mc_group |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index e96385d46b48..9bd52a4c5e17 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -152,8 +152,9 @@ static inline int genl_register_family(struct genl_family *family) | |||
152 | * | 152 | * |
153 | * Return 0 on success or a negative error code. | 153 | * Return 0 on success or a negative error code. |
154 | */ | 154 | */ |
155 | static inline int genl_register_family_with_ops(struct genl_family *family, | 155 | static inline int _genl_register_family_with_ops(struct genl_family *family, |
156 | const struct genl_ops *ops, size_t n_ops) | 156 | const struct genl_ops *ops, |
157 | size_t n_ops) | ||
157 | { | 158 | { |
158 | family->module = THIS_MODULE; | 159 | family->module = THIS_MODULE; |
159 | family->ops = ops; | 160 | family->ops = ops; |
@@ -161,6 +162,9 @@ static inline int genl_register_family_with_ops(struct genl_family *family, | |||
161 | return __genl_register_family(family); | 162 | return __genl_register_family(family); |
162 | } | 163 | } |
163 | 164 | ||
165 | #define genl_register_family_with_ops(family, ops) \ | ||
166 | _genl_register_family_with_ops((family), (ops), ARRAY_SIZE(ops)) | ||
167 | |||
164 | int genl_unregister_family(struct genl_family *family); | 168 | int genl_unregister_family(struct genl_family *family); |
165 | int genl_register_mc_group(struct genl_family *family, | 169 | int genl_register_mc_group(struct genl_family *family, |
166 | struct genl_multicast_group *grp); | 170 | struct genl_multicast_group *grp); |
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index 76595cd9d211..13d2f7cd65db 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -703,8 +703,7 @@ static int __init taskstats_init(void) | |||
703 | { | 703 | { |
704 | int rc; | 704 | int rc; |
705 | 705 | ||
706 | rc = genl_register_family_with_ops(&family, taskstats_ops, | 706 | rc = genl_register_family_with_ops(&family, taskstats_ops); |
707 | ARRAY_SIZE(taskstats_ops)); | ||
708 | if (rc) | 707 | if (rc) |
709 | return rc; | 708 | return rc; |
710 | 709 | ||
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index f9fe2f22d20b..0efc5028ba9d 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
@@ -365,8 +365,7 @@ static int __init init_net_drop_monitor(void) | |||
365 | } | 365 | } |
366 | 366 | ||
367 | rc = genl_register_family_with_ops(&net_drop_monitor_family, | 367 | rc = genl_register_family_with_ops(&net_drop_monitor_family, |
368 | dropmon_ops, | 368 | dropmon_ops); |
369 | ARRAY_SIZE(dropmon_ops)); | ||
370 | if (rc) { | 369 | if (rc) { |
371 | pr_err("Could not create drop monitor netlink family\n"); | 370 | pr_err("Could not create drop monitor netlink family\n"); |
372 | return rc; | 371 | return rc; |
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 3b9205d2afc4..f182260be76d 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c | |||
@@ -414,8 +414,7 @@ int __init hsr_netlink_init(void) | |||
414 | if (rc) | 414 | if (rc) |
415 | goto fail_rtnl_link_register; | 415 | goto fail_rtnl_link_register; |
416 | 416 | ||
417 | rc = genl_register_family_with_ops(&hsr_genl_family, hsr_ops, | 417 | rc = genl_register_family_with_ops(&hsr_genl_family, hsr_ops); |
418 | ARRAY_SIZE(hsr_ops)); | ||
419 | if (rc) | 418 | if (rc) |
420 | goto fail_genl_register_family; | 419 | goto fail_genl_register_family; |
421 | 420 | ||
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index 3ffcdbb56aab..1a81709a4717 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c | |||
@@ -129,8 +129,7 @@ int __init ieee802154_nl_init(void) | |||
129 | { | 129 | { |
130 | int rc; | 130 | int rc; |
131 | 131 | ||
132 | rc = genl_register_family_with_ops(&nl802154_family, ieee8021154_ops, | 132 | rc = genl_register_family_with_ops(&nl802154_family, ieee8021154_ops); |
133 | ARRAY_SIZE(ieee8021154_ops)); | ||
134 | if (rc) | 133 | if (rc) |
135 | return rc; | 134 | return rc; |
136 | 135 | ||
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 8c121b523eee..06493736fbc8 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -1082,8 +1082,7 @@ void __init tcp_metrics_init(void) | |||
1082 | if (ret < 0) | 1082 | if (ret < 0) |
1083 | goto cleanup; | 1083 | goto cleanup; |
1084 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, | 1084 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, |
1085 | tcp_metrics_nl_ops, | 1085 | tcp_metrics_nl_ops); |
1086 | ARRAY_SIZE(tcp_metrics_nl_ops)); | ||
1087 | if (ret < 0) | 1086 | if (ret < 0) |
1088 | goto cleanup_subsys; | 1087 | goto cleanup_subsys; |
1089 | return; | 1088 | return; |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index bf5d7d476dae..a37b81fe0479 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
@@ -149,8 +149,7 @@ static const struct genl_ops irda_nl_ops[] = { | |||
149 | 149 | ||
150 | int irda_nl_register(void) | 150 | int irda_nl_register(void) |
151 | { | 151 | { |
152 | return genl_register_family_with_ops(&irda_nl_family, | 152 | return genl_register_family_with_ops(&irda_nl_family, irda_nl_ops); |
153 | irda_nl_ops, ARRAY_SIZE(irda_nl_ops)); | ||
154 | } | 153 | } |
155 | 154 | ||
156 | void irda_nl_unregister(void) | 155 | void irda_nl_unregister(void) |
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index 57db66e24f1f..4cfd722e9153 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
@@ -887,13 +887,8 @@ EXPORT_SYMBOL_GPL(l2tp_nl_unregister_ops); | |||
887 | 887 | ||
888 | static int l2tp_nl_init(void) | 888 | static int l2tp_nl_init(void) |
889 | { | 889 | { |
890 | int err; | ||
891 | |||
892 | pr_info("L2TP netlink interface\n"); | 890 | pr_info("L2TP netlink interface\n"); |
893 | err = genl_register_family_with_ops(&l2tp_nl_family, l2tp_nl_ops, | 891 | return genl_register_family_with_ops(&l2tp_nl_family, l2tp_nl_ops); |
894 | ARRAY_SIZE(l2tp_nl_ops)); | ||
895 | |||
896 | return err; | ||
897 | } | 892 | } |
898 | 893 | ||
899 | static void l2tp_nl_cleanup(void) | 894 | static void l2tp_nl_cleanup(void) |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index fc8a04ed8854..393498704691 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -3666,7 +3666,7 @@ static const struct genl_ops ip_vs_genl_ops[] __read_mostly = { | |||
3666 | static int __init ip_vs_genl_register(void) | 3666 | static int __init ip_vs_genl_register(void) |
3667 | { | 3667 | { |
3668 | return genl_register_family_with_ops(&ip_vs_genl_family, | 3668 | return genl_register_family_with_ops(&ip_vs_genl_family, |
3669 | ip_vs_genl_ops, ARRAY_SIZE(ip_vs_genl_ops)); | 3669 | ip_vs_genl_ops); |
3670 | } | 3670 | } |
3671 | 3671 | ||
3672 | static void ip_vs_genl_unregister(void) | 3672 | static void ip_vs_genl_unregister(void) |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index 706691739b99..69345cebe3a3 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -783,5 +783,5 @@ static const struct genl_ops netlbl_cipsov4_ops[] = { | |||
783 | int __init netlbl_cipsov4_genl_init(void) | 783 | int __init netlbl_cipsov4_genl_init(void) |
784 | { | 784 | { |
785 | return genl_register_family_with_ops(&netlbl_cipsov4_gnl_family, | 785 | return genl_register_family_with_ops(&netlbl_cipsov4_gnl_family, |
786 | netlbl_cipsov4_ops, ARRAY_SIZE(netlbl_cipsov4_ops)); | 786 | netlbl_cipsov4_ops); |
787 | } | 787 | } |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 7de6f660b80a..8ef83ee97c6a 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -779,5 +779,5 @@ static const struct genl_ops netlbl_mgmt_genl_ops[] = { | |||
779 | int __init netlbl_mgmt_genl_init(void) | 779 | int __init netlbl_mgmt_genl_init(void) |
780 | { | 780 | { |
781 | return genl_register_family_with_ops(&netlbl_mgmt_gnl_family, | 781 | return genl_register_family_with_ops(&netlbl_mgmt_gnl_family, |
782 | netlbl_mgmt_genl_ops, ARRAY_SIZE(netlbl_mgmt_genl_ops)); | 782 | netlbl_mgmt_genl_ops); |
783 | } | 783 | } |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 76ee9252daa7..43817d73ccf9 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -1397,7 +1397,7 @@ static const struct genl_ops netlbl_unlabel_genl_ops[] = { | |||
1397 | int __init netlbl_unlabel_genl_init(void) | 1397 | int __init netlbl_unlabel_genl_init(void) |
1398 | { | 1398 | { |
1399 | return genl_register_family_with_ops(&netlbl_unlabel_gnl_family, | 1399 | return genl_register_family_with_ops(&netlbl_unlabel_gnl_family, |
1400 | netlbl_unlabel_genl_ops, ARRAY_SIZE(netlbl_unlabel_genl_ops)); | 1400 | netlbl_unlabel_genl_ops); |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | /* | 1403 | /* |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index f54215d7b8f3..c68ce73619b5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -906,11 +906,13 @@ static int genl_ctrl_event(int event, void *data) | |||
906 | return 0; | 906 | return 0; |
907 | } | 907 | } |
908 | 908 | ||
909 | static struct genl_ops genl_ctrl_ops = { | 909 | static struct genl_ops genl_ctrl_ops[] = { |
910 | .cmd = CTRL_CMD_GETFAMILY, | 910 | { |
911 | .doit = ctrl_getfamily, | 911 | .cmd = CTRL_CMD_GETFAMILY, |
912 | .dumpit = ctrl_dumpfamily, | 912 | .doit = ctrl_getfamily, |
913 | .policy = ctrl_policy, | 913 | .dumpit = ctrl_dumpfamily, |
914 | .policy = ctrl_policy, | ||
915 | }, | ||
914 | }; | 916 | }; |
915 | 917 | ||
916 | static struct genl_multicast_group notify_grp = { | 918 | static struct genl_multicast_group notify_grp = { |
@@ -954,7 +956,7 @@ static int __init genl_init(void) | |||
954 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) | 956 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) |
955 | INIT_LIST_HEAD(&family_ht[i]); | 957 | INIT_LIST_HEAD(&family_ht[i]); |
956 | 958 | ||
957 | err = genl_register_family_with_ops(&genl_ctrl, &genl_ctrl_ops, 1); | 959 | err = genl_register_family_with_ops(&genl_ctrl, genl_ctrl_ops); |
958 | if (err < 0) | 960 | if (err < 0) |
959 | goto problem; | 961 | goto problem; |
960 | 962 | ||
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index f5585611c098..fe6760d328a0 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
@@ -1536,8 +1536,7 @@ int __init nfc_genl_init(void) | |||
1536 | { | 1536 | { |
1537 | int rc; | 1537 | int rc; |
1538 | 1538 | ||
1539 | rc = genl_register_family_with_ops(&nfc_genl_family, nfc_genl_ops, | 1539 | rc = genl_register_family_with_ops(&nfc_genl_family, nfc_genl_ops); |
1540 | ARRAY_SIZE(nfc_genl_ops)); | ||
1541 | if (rc) | 1540 | if (rc) |
1542 | return rc; | 1541 | return rc; |
1543 | 1542 | ||
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 91e1c927a465..8ec8b73033e0 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -1817,8 +1817,9 @@ static int dp_register_genl(void) | |||
1817 | for (i = 0; i < ARRAY_SIZE(dp_genl_families); i++) { | 1817 | for (i = 0; i < ARRAY_SIZE(dp_genl_families); i++) { |
1818 | const struct genl_family_and_ops *f = &dp_genl_families[i]; | 1818 | const struct genl_family_and_ops *f = &dp_genl_families[i]; |
1819 | 1819 | ||
1820 | err = genl_register_family_with_ops(f->family, f->ops, | 1820 | f->family->ops = f->ops; |
1821 | f->n_ops); | 1821 | f->family->n_ops = f->n_ops; |
1822 | err = genl_register_family(f->family); | ||
1822 | if (err) | 1823 | if (err) |
1823 | goto error; | 1824 | goto error; |
1824 | n_registered++; | 1825 | n_registered++; |
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 8bcd4985d0fb..9f72a6376362 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -76,9 +76,11 @@ static struct genl_family tipc_genl_family = { | |||
76 | .maxattr = 0, | 76 | .maxattr = 0, |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static struct genl_ops tipc_genl_ops = { | 79 | static struct genl_ops tipc_genl_ops[] = { |
80 | .cmd = TIPC_GENL_CMD, | 80 | { |
81 | .doit = handle_cmd, | 81 | .cmd = TIPC_GENL_CMD, |
82 | .doit = handle_cmd, | ||
83 | }, | ||
82 | }; | 84 | }; |
83 | 85 | ||
84 | static int tipc_genl_family_registered; | 86 | static int tipc_genl_family_registered; |
@@ -87,8 +89,7 @@ int tipc_netlink_start(void) | |||
87 | { | 89 | { |
88 | int res; | 90 | int res; |
89 | 91 | ||
90 | res = genl_register_family_with_ops(&tipc_genl_family, | 92 | res = genl_register_family_with_ops(&tipc_genl_family, tipc_genl_ops); |
91 | &tipc_genl_ops, 1); | ||
92 | if (res) { | 93 | if (res) { |
93 | pr_err("Failed to register netlink interface\n"); | 94 | pr_err("Failed to register netlink interface\n"); |
94 | return res; | 95 | return res; |
diff --git a/net/wimax/stack.c b/net/wimax/stack.c index 47170c9495f1..6328afe90319 100644 --- a/net/wimax/stack.c +++ b/net/wimax/stack.c | |||
@@ -597,8 +597,8 @@ int __init wimax_subsys_init(void) | |||
597 | 597 | ||
598 | snprintf(wimax_gnl_family.name, sizeof(wimax_gnl_family.name), | 598 | snprintf(wimax_gnl_family.name, sizeof(wimax_gnl_family.name), |
599 | "WiMAX"); | 599 | "WiMAX"); |
600 | result = genl_register_family_with_ops(&wimax_gnl_family, wimax_gnl_ops, | 600 | result = genl_register_family_with_ops(&wimax_gnl_family, |
601 | ARRAY_SIZE(wimax_gnl_ops)); | 601 | wimax_gnl_ops); |
602 | if (unlikely(result < 0)) { | 602 | if (unlikely(result < 0)) { |
603 | printk(KERN_ERR "cannot register generic netlink family: %d\n", | 603 | printk(KERN_ERR "cannot register generic netlink family: %d\n", |
604 | result); | 604 | result); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 58c43c8e149f..1b6c5dd4dccf 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -11329,8 +11329,7 @@ int nl80211_init(void) | |||
11329 | { | 11329 | { |
11330 | int err; | 11330 | int err; |
11331 | 11331 | ||
11332 | err = genl_register_family_with_ops(&nl80211_fam, | 11332 | err = genl_register_family_with_ops(&nl80211_fam, nl80211_ops); |
11333 | nl80211_ops, ARRAY_SIZE(nl80211_ops)); | ||
11334 | if (err) | 11333 | if (err) |
11335 | return err; | 11334 | return err; |
11336 | 11335 | ||