diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-17 02:01:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-17 02:01:49 -0500 |
commit | 4d24b52ac5085ef8a264d044f1b302b7c029887a (patch) | |
tree | 3842c484d49f97bc441ef9e6a31de09fa2f683f5 /net/sched/ematch.c | |
parent | 6eba6a372b501aa3cdfb7df21a8364099125b9c4 (diff) |
ematch: simpler tcf_em_unregister()
Simply delete ops from list and let list debugging do the job.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/ematch.c')
-rw-r--r-- | net/sched/ematch.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index e82519e548d7..aab59409728b 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -71,7 +71,7 @@ | |||
71 | * | 71 | * |
72 | * static void __exit exit_my_ematch(void) | 72 | * static void __exit exit_my_ematch(void) |
73 | * { | 73 | * { |
74 | * return tcf_em_unregister(&my_ops); | 74 | * tcf_em_unregister(&my_ops); |
75 | * } | 75 | * } |
76 | * | 76 | * |
77 | * module_init(init_my_ematch); | 77 | * module_init(init_my_ematch); |
@@ -154,23 +154,11 @@ EXPORT_SYMBOL(tcf_em_register); | |||
154 | * | 154 | * |
155 | * Returns -ENOENT if no matching ematch was found. | 155 | * Returns -ENOENT if no matching ematch was found. |
156 | */ | 156 | */ |
157 | int tcf_em_unregister(struct tcf_ematch_ops *ops) | 157 | void tcf_em_unregister(struct tcf_ematch_ops *ops) |
158 | { | 158 | { |
159 | int err = 0; | ||
160 | struct tcf_ematch_ops *e; | ||
161 | |||
162 | write_lock(&ematch_mod_lock); | 159 | write_lock(&ematch_mod_lock); |
163 | list_for_each_entry(e, &ematch_ops, link) { | 160 | list_del(&ops->link); |
164 | if (e == ops) { | ||
165 | list_del(&e->link); | ||
166 | goto out; | ||
167 | } | ||
168 | } | ||
169 | |||
170 | err = -ENOENT; | ||
171 | out: | ||
172 | write_unlock(&ematch_mod_lock); | 161 | write_unlock(&ematch_mod_lock); |
173 | return err; | ||
174 | } | 162 | } |
175 | EXPORT_SYMBOL(tcf_em_unregister); | 163 | EXPORT_SYMBOL(tcf_em_unregister); |
176 | 164 | ||