From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 852C143BD7; Wed, 28 Feb 2024 00:56:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46B9C402A9; Wed, 28 Feb 2024 00:56:58 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EB62C40295 for ; Wed, 28 Feb 2024 00:56:56 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 521C420B74C2; Tue, 27 Feb 2024 15:56:56 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 521C420B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709078216; bh=sS0fxsFYHt5g+COMzG64UWENaLHUXNX8eD4SomL21Sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQ1AjJE9zTCeXTuTpVCwI2xQdRI7q9F/yM33spg4eEF9zzGSUQScgcshpg45pB20n ay8Zl2nbIoo49Wygvq4b3aU6gNt8qUCF7Uf8MBK9Zq6sPVBdcFUHwb4pFXaTX4es+k 8OrHAwmKjMIFHfN1y5MMjLrwEt3blG9vV932uKgE= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Cristian Dumitrescu , Honnappa Nagarahalli , Sameh Gobriel , Vladimir Medvedkin , Yipeng Wang , mb@smartsharesystems.com, fengchengwen@huawei.com, Tyler Retzlaff Subject: [PATCH v3 2/6] rcu: replace zero length array with flex array Date: Tue, 27 Feb 2024 15:56:51 -0800 Message-Id: <1709078215-20292-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709078215-20292-1-git-send-email-roretzla@linux.microsoft.com> References: <1706134657-17446-1-git-send-email-roretzla@linux.microsoft.com> <1709078215-20292-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Zero length arrays are GNU extension. Replace with standard flex array. Signed-off-by: Tyler Retzlaff Reviewed-by: Honnappa Nagarahalli Reviewed-by: Morten Brørup Acked-by: Chengwen Feng Acked-by: Stephen Hemminger --- lib/rcu/rcu_qsbr_pvt.h | 2 +- lib/rcu/rte_rcu_qsbr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rcu/rcu_qsbr_pvt.h b/lib/rcu/rcu_qsbr_pvt.h index 5fd7ca2..96d05e6 100644 --- a/lib/rcu/rcu_qsbr_pvt.h +++ b/lib/rcu/rcu_qsbr_pvt.h @@ -52,7 +52,7 @@ struct rte_rcu_qsbr_dq { */ typedef struct { uint64_t token; /**< Token */ - uint8_t elem[0]; /**< Pointer to user element */ + uint8_t elem[]; /**< Pointer to user element */ } __attribute__((__may_alias__)) __rte_rcu_qsbr_dq_elem_t; #endif /* _RTE_RCU_QSBR_PVT_H_ */ diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index e7ef788..af9cbea 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -106,7 +106,7 @@ struct rte_rcu_qsbr { uint32_t max_threads; /**< Maximum number of threads using this QS variable */ - struct rte_rcu_qsbr_cnt qsbr_cnt[0] __rte_cache_aligned; + struct rte_rcu_qsbr_cnt qsbr_cnt[] __rte_cache_aligned; /**< Quiescent state counter array of 'max_threads' elements */ /**< Registered thread IDs are stored in a bitmap array, -- 1.8.3.1