From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx.bisdn.de (mx.bisdn.de [185.27.182.31]) by dpdk.org (Postfix) with ESMTP id 081B27E7B for ; Wed, 22 Oct 2014 12:14:54 +0200 (CEST) Received: from localhost.localdomain (unknown [172.16.251.36]) by mx.bisdn.de (Postfix) with ESMTP id E8701A2DA9; Wed, 22 Oct 2014 12:23:12 +0200 (CEST) From: Marc Sune To: dev@dpdk.org Date: Wed, 22 Oct 2014 12:23:11 +0200 Message-Id: <1413973391-10272-1-git-send-email-marc.sune@bisdn.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1818029.CqCeQSHIe6@xps13> References: <1818029.CqCeQSHIe6@xps13> Subject: [dpdk-dev] [PATCH v2] KNI: fix compilation warning 'missing-field-initializers' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 10:14:54 -0000 Fix compilation warning 'missing-field-initializers' for some GCC and clang versions introduced in commit 0c6bc8e due to the use of C89/C90 initializers. Using C99-style initializers Signed-off-by: Marc Sune --- lib/librte_kni/rte_kni.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index f64a0a8..ab5ca38 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -131,7 +131,9 @@ static void kni_free_mbufs(struct rte_kni *kni); static void kni_allocate_mbufs(struct rte_kni *kni); static volatile int kni_fd = -1; -static struct rte_kni_memzone_pool kni_memzone_pool = {0}; +static struct rte_kni_memzone_pool kni_memzone_pool = { + .initialized = 0, +}; static const struct rte_memzone * kni_memzone_reserve(const char *name, size_t len, int socket_id, @@ -224,6 +226,7 @@ rte_kni_init(unsigned int max_kni_ifaces) kni_memzone_pool.initialized = 1; kni_memzone_pool.max_ifaces = max_kni_ifaces; kni_memzone_pool.free = &kni_memzone_pool.slots[0]; + rte_spinlock_init(&kni_memzone_pool.mutex); /* Pre-allocate all memzones of all the slots; panic on error */ for (i = 0; i < max_kni_ifaces; i++) { -- 1.7.10.4