[PATCH] examples/vm_power: replace list foreach with while loop

Stephen Hemminger stephen at networkplumber.org
Thu Mar 10 18:21:24 CET 2022


On Thu, 10 Mar 2022 09:32:08 +0000
"Koikkara Reeny, Shibin" <shibin.koikkara.reeny at intel.com> wrote:

> > -----Original Message-----
> > From: Thomas Monjalon <thomas at monjalon.net>
> > 01/03/2022 15:53, Shibin Koikkara Reeny:  
> > > Linux header files don't support LIST_FOREACH_SAFE so replacing
> > > LIST_FOREACH with while loop.  
> > 
> > What is the original issue you are trying to solve?  
> Asan tool reported LIST_FOREACH should be replaced with LIST_FOREACH_SAFE but 
> Linux don't have LIST_FOREACH_SAFE API. So replacing it with while loop.
> 
> Regards,
> Shibin

Why not just clone LIST_FOREACH_SAFE from BSD?
That is what RTE_TAILQ does.

It might be generally useful.


More information about the dev mailing list