Skip to content

Commit

Permalink
net_sched: cls_basic: remove unnecessary iteration and use passed arg
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Dec 9, 2014
1 parent ae0bf04 commit e438645
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions net/sched/cls_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down

0 comments on commit e438645

Please sign in to comment.