[PATCH 5/5] eal: simplify eal alarm cancel by using LIST_FOREACH_SAFE

Morten Brørup mb at smartsharesystems.com
Fri Aug 9 10:33:49 CEST 2024


> +++ b/lib/eal/linux/eal_alarm.c
> @@ -53,6 +53,13 @@ static struct rte_intr_handle *intr_handle;
>  static int handler_registered = 0;
>  static void eal_alarm_callback(void *arg);
> 
> +#ifndef LIST_FOREACH_SAFE
> +#define LIST_FOREACH_SAFE(var, head, field, tvar)			\
> +	for ((var) = LIST_FIRST((head));				\
> +	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
> +	    (var) = (tvar))
> +#endif

This macro is already defined for Windows [1]; isn't it also defined in some Linux/BSD standard header file already?

[1]: https://elixir.bootlin.com/dpdk/v24.07/source/lib/eal/windows/include/sys/queue.h#L515



More information about the dev mailing list