xt_mp2t: reduce mp2t_mt_reg from an array to single-level struct

There's just one currently anyway.
This commit is contained in:
Jan Engelhardt
2010-11-04 00:22:32 +01:00
parent 304bbf0846
commit 305af4210b

View File

@@ -1172,8 +1172,7 @@ xt_mp2t_match(const struct sk_buff *skb, struct xt_action_param *par)
return res; return res;
} }
static struct xt_match mp2t_mt_reg[] __read_mostly = { static struct xt_match mp2t_mt_reg __read_mostly = {
{
.name = "mp2t", .name = "mp2t",
.revision = 0, .revision = 0,
.family = NFPROTO_IPV4, .family = NFPROTO_IPV4,
@@ -1183,7 +1182,6 @@ static struct xt_match mp2t_mt_reg[] __read_mostly = {
.proto = IPPROTO_UDP, .proto = IPPROTO_UDP,
.matchsize = sizeof(struct xt_mp2t_mtinfo), .matchsize = sizeof(struct xt_mp2t_mtinfo),
.me = THIS_MODULE, .me = THIS_MODULE,
},
}; };
@@ -1376,7 +1374,7 @@ static int __init mp2t_mt_init(void)
msg_dbg(DRV, "Message level (msg_level): 0x%X", msg_level); msg_dbg(DRV, "Message level (msg_level): 0x%X", msg_level);
/* Register the mp2t matches */ /* Register the mp2t matches */
err = xt_register_matches(mp2t_mt_reg, ARRAY_SIZE(mp2t_mt_reg)); err = xt_register_match(&mp2t_mt_reg);
if (err) { if (err) {
msg_err(DRV, "unable to register matches"); msg_err(DRV, "unable to register matches");
return err; return err;
@@ -1388,7 +1386,7 @@ static int __init mp2t_mt_init(void)
if (!mp2t_procdir) { if (!mp2t_procdir) {
msg_err(DRV, "unable to create proc dir entry"); msg_err(DRV, "unable to create proc dir entry");
/* In case of error unregister the mp2t matches */ /* In case of error unregister the mp2t matches */
xt_unregister_matches(mp2t_mt_reg, ARRAY_SIZE(mp2t_mt_reg)); xt_unregister_match(&mp2t_mt_reg);
err = -ENOMEM; err = -ENOMEM;
} }
#endif #endif
@@ -1402,7 +1400,7 @@ static void __exit mp2t_mt_exit(void)
remove_proc_entry(XT_MODULE_NAME, init_net.proc_net); remove_proc_entry(XT_MODULE_NAME, init_net.proc_net);
xt_unregister_matches(mp2t_mt_reg, ARRAY_SIZE(mp2t_mt_reg)); xt_unregister_match(&mp2t_mt_reg);
/* Its important to wait for all call_rcu_bh() callbacks to /* Its important to wait for all call_rcu_bh() callbacks to
* finish before this module is deallocated as the code * finish before this module is deallocated as the code