On Mon, Nov 28, 2022 at 02:54:31PM +0100, Alexander Bluhm wrote: > > NB: While here, nd6 and frag6 could statically initalise their lists > > right away (they're both static/local to nd6.c and frag6.c anyway), but > > I see no big adavantage of variable initializer over ..._init() > function. The latter is there anyway. > > > that should probably be another diff, if at all, with more static added > > to those files. > > Why is static in the kernel a benefit? There were times when static > was no allowed to have more complete symbol list.
Seeing a static variable immediately tells me that it is not used outside the function or compilation unit. Imho, this makes it easier to work with the code, as you don't have to cross-check and grep for variables, whether they're used somewhere else, behind some language construct which made your grep not show it... On the other hand, I do see how changing static around for existing code is quite some churn, so I'll refrain from doing so here.