Commit c5a0edae authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: mscc: ocelot: use list_for_each_entry in ocelot_vcap_block_remove_filter

Simplify ocelot_vcap_block_remove_filter by using list_for_each_entry
instead of list_for_each.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9f52c34
...@@ -1195,18 +1195,16 @@ static void ocelot_vcap_block_remove_filter(struct ocelot *ocelot, ...@@ -1195,18 +1195,16 @@ static void ocelot_vcap_block_remove_filter(struct ocelot *ocelot,
struct ocelot_vcap_block *block, struct ocelot_vcap_block *block,
struct ocelot_vcap_filter *filter) struct ocelot_vcap_filter *filter)
{ {
struct ocelot_vcap_filter *tmp; struct ocelot_vcap_filter *tmp, *n;
struct list_head *pos, *q;
list_for_each_safe(pos, q, &block->rules) { list_for_each_entry_safe(tmp, n, &block->rules, list) {
tmp = list_entry(pos, struct ocelot_vcap_filter, list);
if (ocelot_vcap_filter_equal(filter, tmp)) { if (ocelot_vcap_filter_equal(filter, tmp)) {
if (tmp->block_id == VCAP_IS2 && if (tmp->block_id == VCAP_IS2 &&
tmp->action.police_ena) tmp->action.police_ena)
ocelot_vcap_policer_del(ocelot, ocelot_vcap_policer_del(ocelot,
tmp->action.pol_ix); tmp->action.pol_ix);
list_del(pos); list_del(&tmp->list);
kfree(tmp); kfree(tmp);
} }
} }
......
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