[RFC 46/47] net/mvpp2: replace local definition of FOREACH_SAFE

Stephen Hemminger stephen at networkplumber.org
Tue Aug 19 01:27:57 CEST 2025


There is now a standard macro for this.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/mvpp2/mrvl_mtr.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_mtr.c b/drivers/net/mvpp2/mrvl_mtr.c
index c07ac95ddc..27596b8c99 100644
--- a/drivers/net/mvpp2/mrvl_mtr.c
+++ b/drivers/net/mvpp2/mrvl_mtr.c
@@ -505,13 +505,9 @@ mrvl_mtr_deinit(struct rte_eth_dev *dev)
 	struct mrvl_mtr_profile *profile, *tmp_profile;
 	struct mrvl_mtr *mtr, *tmp_mtr;
 
-	for (mtr = LIST_FIRST(&priv->mtrs);
-	     mtr && (tmp_mtr = LIST_NEXT(mtr, next), 1);
-	     mtr = tmp_mtr)
+	LIST_FOREACH_SAFE(mtr, &priv->mtrs, next, tmp_mtr)
 		mrvl_destroy(dev, mtr->mtr_id, NULL);
 
-	for (profile = LIST_FIRST(&priv->profiles);
-	     profile && (tmp_profile = LIST_NEXT(profile, next), 1);
-	     profile = tmp_profile)
+	LIST_FOREACH_SAFE(profile, &priv_profiles, next, tmp_profile)
 		mrvl_meter_profile_delete(dev, profile->profile_id, NULL);
 }
-- 
2.47.2



More information about the dev mailing list