[v4,6/6] table: replace zero length array with flex array
Checks
Commit Message
Zero length arrays are GNU extension. Replace with
standard flex array.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/table/rte_table_acl.c | 2 +-
lib/table/rte_table_array.c | 2 +-
lib/table/rte_table_hash_cuckoo.c | 2 +-
lib/table/rte_table_hash_ext.c | 2 +-
lib/table/rte_table_hash_key16.c | 2 +-
lib/table/rte_table_hash_key32.c | 2 +-
lib/table/rte_table_hash_key8.c | 2 +-
lib/table/rte_table_hash_lru.c | 2 +-
lib/table/rte_table_lpm.c | 2 +-
lib/table/rte_table_lpm_ipv6.c | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
Comments
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Thursday, 29 February 2024 23.59
>
> Zero length arrays are GNU extension. Replace with
> standard flex array.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
@@ -47,7 +47,7 @@ struct rte_table_acl {
uint8_t *acl_rule_memory; /* Memory to store the rules */
/* Memory to store the action table and stack of free entries */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
@@ -39,7 +39,7 @@ struct rte_table_array {
uint32_t entry_pos_mask;
/* Internal table */
- uint8_t array[0] __rte_cache_aligned;
+ uint8_t array[] __rte_cache_aligned;
} __rte_cache_aligned;
static void *
@@ -42,7 +42,7 @@ struct rte_table_hash {
struct rte_hash *h_table;
/* Lookup table */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -99,7 +99,7 @@ struct rte_table_hash {
uint32_t *bkt_ext_stack;
/* Table memory */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -83,7 +83,7 @@ struct rte_table_hash {
uint32_t *stack;
/* Lookup table */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -83,7 +83,7 @@ struct rte_table_hash {
uint32_t *stack;
/* Lookup table */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -79,7 +79,7 @@ struct rte_table_hash {
uint32_t *stack;
/* Lookup table */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -76,7 +76,7 @@ struct rte_table_hash {
uint32_t *key_stack;
/* Table memory */
- uint8_t memory[0] __rte_cache_aligned;
+ uint8_t memory[] __rte_cache_aligned;
};
static int
@@ -47,7 +47,7 @@ struct rte_table_lpm {
/* Next Hop Table (NHT) */
uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS];
- uint8_t nht[0] __rte_cache_aligned;
+ uint8_t nht[] __rte_cache_aligned;
};
static void *
@@ -44,7 +44,7 @@ struct rte_table_lpm_ipv6 {
/* Next Hop Table (NHT) */
uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS];
- uint8_t nht[0] __rte_cache_aligned;
+ uint8_t nht[] __rte_cache_aligned;
};
static void *