[dpdk-dev] [PATCH] examples/multi_process: fix RX packets distribution
Gregory Etelson
getelson at nvidia.com
Tue Nov 9 07:42:16 CET 2021
Hello Thomas,
>
> 28/10/2021 17:35, Burakov, Anatoly:
> > On 28-Oct-21 4:14 PM, Gregory Etelson wrote:
> > >>> - uint8_t client = 0;
> > >>> + static uint8_t client = 0;
> >
> > Acked-by: Anatoly Burakov
> <anatoly.burakov at intel.com>
>
> checkpatch has a message for you:
> ERROR:INITIALISED_STATIC: do not initialise
> statics to 0
>
Turning the `client` variable to static ensured that the next time
the function will be called it will proceed iterating clients instead of
starting a loop from the beginning - that's the main idea of that patch.
The variable must be initialized to 0 because the application model
requires at least a single client with index 0.
ANSI C allows static variables initialization to any valid value.
Do you know why the checkpatch utility denied such initialization ?
Regards,
Gregory
More information about the dev
mailing list