Commit 4d24b52a authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller

ematch: simpler tcf_em_unregister()

Simply delete ops from list and let list debugging do the job.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6eba6a37
...@@ -246,7 +246,7 @@ struct tcf_ematch_ops ...@@ -246,7 +246,7 @@ struct tcf_ematch_ops
}; };
extern int tcf_em_register(struct tcf_ematch_ops *); extern int tcf_em_register(struct tcf_ematch_ops *);
extern int tcf_em_unregister(struct tcf_ematch_ops *); extern void tcf_em_unregister(struct tcf_ematch_ops *);
extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
struct tcf_ematch_tree *); struct tcf_ematch_tree *);
extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
* *
* static void __exit exit_my_ematch(void) * static void __exit exit_my_ematch(void)
* { * {
* return tcf_em_unregister(&my_ops); * tcf_em_unregister(&my_ops);
* } * }
* *
* module_init(init_my_ematch); * module_init(init_my_ematch);
...@@ -154,23 +154,11 @@ EXPORT_SYMBOL(tcf_em_register); ...@@ -154,23 +154,11 @@ EXPORT_SYMBOL(tcf_em_register);
* *
* Returns -ENOENT if no matching ematch was found. * Returns -ENOENT if no matching ematch was found.
*/ */
int tcf_em_unregister(struct tcf_ematch_ops *ops) void tcf_em_unregister(struct tcf_ematch_ops *ops)
{ {
int err = 0;
struct tcf_ematch_ops *e;
write_lock(&ematch_mod_lock); write_lock(&ematch_mod_lock);
list_for_each_entry(e, &ematch_ops, link) { list_del(&ops->link);
if (e == ops) {
list_del(&e->link);
goto out;
}
}
err = -ENOENT;
out:
write_unlock(&ematch_mod_lock); write_unlock(&ematch_mod_lock);
return err;
} }
EXPORT_SYMBOL(tcf_em_unregister); EXPORT_SYMBOL(tcf_em_unregister);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment