[v3,8/9] net/i40e: replace open coded version of LIST_FOREACH_SAFE
Checks
Commit Message
Use macro instead.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/intel/i40e/i40e_ethdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
@@ -29,6 +29,7 @@
#include <rte_hash_crc.h>
#include <rte_bitmap.h>
#include <rte_os_shim.h>
+#include <rte_queue.h>
#include "i40e_logs.h"
#include "base/i40e_prototype.h"
@@ -5096,16 +5097,12 @@ i40e_res_pool_destroy(struct i40e_res_pool_info *pool)
if (pool == NULL)
return;
- for (entry = LIST_FIRST(&pool->alloc_list);
- entry && (next_entry = LIST_NEXT(entry, next), 1);
- entry = next_entry) {
+ LIST_FOREACH_SAFE(entry, &pool->alloc_list, next, next_entry) {
LIST_REMOVE(entry, next);
rte_free(entry);
}
- for (entry = LIST_FIRST(&pool->free_list);
- entry && (next_entry = LIST_NEXT(entry, next), 1);
- entry = next_entry) {
+ LIST_FOREACH_SAFE(entry, &pool->free_list, next, next_entry) {
LIST_REMOVE(entry, next);
rte_free(entry);
}