[dpdk-dev,v1,1/4] net/mlx4: use dedicated list iterator

Message ID 1508429034-27506-2-git-send-email-adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Adrien Mazarguil Oct. 19, 2017, 4:11 p.m. UTC
  Dumb unconditional iteration on flow rules should be performed using the
dedicated macro.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx4/mlx4_flow.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 5c4bf8e..5af6efb 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -1460,9 +1460,7 @@  mlx4_flow_sync(struct priv *priv, struct rte_flow_error *error)
 			return ret;
 	}
 	/* Toggle the remaining flow rules . */
-	for (flow = LIST_FIRST(&priv->flows);
-	     flow;
-	     flow = LIST_NEXT(flow, next)) {
+	LIST_FOREACH(flow, &priv->flows, next) {
 		ret = mlx4_flow_toggle(priv, flow, priv->started, error);
 		if (ret)
 			return ret;