From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] KNI: fix compilation warning 'missing-field-initializers' Date: Wed, 22 Oct 2014 10:50:17 +0200 Message-ID: <4364683.dn9JoP4MXp@xps13> References: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D8288F@SHSMSX101.ccr.corp.intel.com> <2234340.4n5qb1rBlX@xps13> <54476DF9.6060906@bisdn.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Marc Sune Return-path: In-Reply-To: <54476DF9.6060906-kpkqNMk1I7M@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-10-22 10:42, Marc Sune: > The mutex needs to be initialized to RTE_SPINLOCK_INITIALIZER(0) too, or > move the initialization of the mutex to rte_kni_init(). RTE_SPINLOCK_INITIALIZER is { 0 } By initializing one field, all other fields are set to 0, so spinlock also. Just choose one field and it's OK. It should be tested with ICC also but I think it's OK. > I can prepare a second patch with one or the other option, if you want. Yes please. > On 22/10/14 10:37, Thomas Monjalon wrote: > > 2014-10-22 09:10, Marc Sune: > >> Fix for compilation warning 'missing-field-initializers' for some > >> GCC and clang versions introduced in commit 0c6bc8e > >> > >> Signed-off-by: Marc Sune > > It's not needed to initialize all fields. > > This should be sufficient: > > +static struct rte_kni_memzone_pool kni_memzone_pool = {.initialized = 0}; Please Marc, don't top post. Thanks -- Thomas