09/11/2021 07:42, Gregory Etelson: > 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.bura...@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 ?
ANSI C makes static variables iniatilized to 0 by default.