[v5,2/6] rcu: replace zero length array with flex array

Message ID 1709756036-24068-3-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series more replacement of zero length array |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 6, 2024, 8:13 p.m. UTC
  Zero length arrays are GNU extension. Replace with
standard flex array.

Add a temporary suppression for rte_pipeline_table_entry
libabigail bug:

Bugzilla ID: https://sourceware.org/bugzilla/show_bug.cgi?id=31377

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/libabigail.abignore | 3 +++
 lib/rcu/rcu_qsbr_pvt.h       | 2 +-
 lib/rcu/rte_rcu_qsbr.h       | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 645d289..25c73a5 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -35,5 +35,8 @@ 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 [suppress_type]
+	name = rte_rcu_qsbr
+
+[suppress_type]
 	name = rte_eth_fp_ops
 	has_data_member_inserted_between = {offset_of(reserved2), end}
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 0506191..ed3dd6d 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -107,7 +107,7 @@  struct __rte_cache_aligned rte_rcu_qsbr {
 	uint32_t max_threads;
 	/**< Maximum number of threads using this QS variable */
 
-	alignas(RTE_CACHE_LINE_SIZE) struct rte_rcu_qsbr_cnt qsbr_cnt[0];
+	alignas(RTE_CACHE_LINE_SIZE) struct rte_rcu_qsbr_cnt qsbr_cnt[];
 	/**< Quiescent state counter array of 'max_threads' elements */
 
 	/**< Registered thread IDs are stored in a bitmap array,