diff options
author | Jiri Pirko <jiri@resnulli.us> | 2014-12-02 18:00:31 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 20:53:40 -0500 |
commit | e4386456ae4eca2104e67f70a8ff7b7c949fb248 (patch) | |
tree | 75d78d719e43b780a7025ac502d3abee3d8ed795 /net/sched/cls_basic.c | |
parent | ae0bf0402aaa67b6004c186f945bbc9f0717b7dc (diff) |
net_sched: cls_basic: remove unnecessary iteration and use passed arg
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_basic.c')
-rw-r--r-- | net/sched/cls_basic.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index cd61280941e5..1c122c7e0549 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -113,18 +113,12 @@ static void basic_destroy(struct tcf_proto *tp) static int basic_delete(struct tcf_proto *tp, unsigned long arg) { - struct basic_head *head = rtnl_dereference(tp->root); - struct basic_filter *t, *f = (struct basic_filter *) arg; - - list_for_each_entry(t, &head->flist, link) - if (t == f) { - list_del_rcu(&t->link); - tcf_unbind_filter(tp, &t->res); - call_rcu(&t->rcu, basic_delete_filter); - return 0; - } + struct basic_filter *f = (struct basic_filter *) arg; - return -ENOENT; + list_del_rcu(&f->link); + tcf_unbind_filter(tp, &f->res); + call_rcu(&f->rcu, basic_delete_filter); + return 0; } static const struct nla_policy basic_policy[TCA_BASIC_MAX + 1] = { |