net: mscc: ocelot: use list_add_tail in ocelot_vcap_filter_add_to_block()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 3 May 2022 12:01:46 +0000 (15:01 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 May 2022 03:42:14 +0000 (20:42 -0700)
list_add(..., pos->prev) and list_add_tail(..., pos) are equivalent, use
the later form to unify with the case where the list is empty later.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_vcap.c

index 1e74bdb215ec3a4bb7f1f2c4e05398d78598cb62..5b6f22bd0e5f2780867579206a7649abacbfd74e 100644 (file)
@@ -1013,7 +1013,7 @@ static int ocelot_vcap_filter_add_to_block(struct ocelot *ocelot,
                if (filter->prio < tmp->prio)
                        break;
        }
-       list_add(&filter->list, pos->prev);
+       list_add_tail(&filter->list, pos);
 
        return 0;
 }