[v4,3/4] lib: replace zero-length arrays with undimensioned ones
Checks
Commit Message
This patch replaces instances of zero-sized arrays i.e. those at the end
of structures with "[0]" with the more standard syntax of "[]".
Replacement was done using coccinelle script, with some cleanup of
whitespace afterwards.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
lib/cryptodev/cryptodev_pmd.h | 2 +-
lib/cryptodev/rte_cryptodev.h | 2 +-
lib/eventdev/rte_event_timer_adapter.h | 2 +-
lib/ip_frag/ip_reassembly.h | 2 +-
lib/ipsec/sa.h | 2 +-
lib/rib/rte_rib.c | 2 +-
lib/rib/rte_rib6.c | 2 +-
lib/table/rte_swx_table_learner.c | 4 ++--
lib/table/rte_table_hash_key16.c | 4 ++--
lib/table/rte_table_hash_key32.c | 4 ++--
lib/table/rte_table_hash_key8.c | 4 ++--
lib/vhost/rte_vhost.h | 4 ++--
12 files changed, 17 insertions(+), 17 deletions(-)
@@ -673,7 +673,7 @@ RTE_STD_C11 struct rte_cryptodev_asym_session {
uint8_t padding[3];
void *event_mdata;
/**< Event metadata (aka *union rte_event_crypto_metadata*) */
- uint8_t sess_private_data[0];
+ uint8_t sess_private_data[];
};
#ifdef __cplusplus
@@ -918,7 +918,7 @@ struct rte_cryptodev_sym_session {
__extension__ struct {
void *data;
uint16_t refcnt;
- } sess_data[0];
+ } sess_data[];
/**< Driver specific session material, variable size */
};
@@ -486,7 +486,7 @@ struct rte_event_timer {
*/
enum rte_event_timer_state state;
/**< State of the event timer. */
- uint8_t user_meta[0];
+ uint8_t user_meta[];
/**< Memory to store user specific metadata.
* The event timer adapter implementation should not modify this area.
*/
@@ -83,7 +83,7 @@ struct rte_ip_frag_tbl {
struct ip_frag_pkt *last; /* last used entry. */
struct ip_pkt_list lru; /* LRU list for table entries. */
struct ip_frag_tbl_stat stat; /* statistics counters. */
- __extension__ struct ip_frag_pkt pkt[0]; /* hash table. */
+ __extension__ struct ip_frag_pkt pkt[]; /* hash table. */
};
#endif /* _IP_REASSEMBLY_H_ */
@@ -59,7 +59,7 @@ union sym_op_data {
struct replay_sqn {
rte_rwlock_t rwl;
uint64_t sqn;
- __extension__ uint64_t window[0];
+ __extension__ uint64_t window[];
};
/*IPSEC SA supported algorithms */
@@ -35,7 +35,7 @@ struct rte_rib_node {
uint8_t depth;
uint8_t flag;
uint64_t nh;
- __extension__ uint64_t ext[0];
+ __extension__ uint64_t ext[];
};
struct rte_rib {
@@ -34,7 +34,7 @@ struct rte_rib6_node {
uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE];
uint8_t depth;
uint8_t flag;
- __extension__ uint64_t ext[0];
+ __extension__ uint64_t ext[];
};
struct rte_rib6 {
@@ -252,7 +252,7 @@ struct table_bucket {
uint32_t sig[TABLE_KEYS_PER_BUCKET];
uint8_t key_timeout_id[TABLE_KEYS_PER_BUCKET];
uint8_t pad[TABLE_BUCKET_PAD_SIZE];
- uint8_t key[0];
+ uint8_t key[];
};
struct table_params {
@@ -317,7 +317,7 @@ struct table {
uint8_t key_mask0[RTE_CACHE_LINE_SIZE];
/* Table buckets. */
- uint8_t buckets[0];
+ uint8_t buckets[];
} __rte_cache_aligned;
/* The timeout (in cycles) is stored in the table as a 32-bit value by truncating its least
@@ -43,7 +43,7 @@ struct rte_bucket_4_16 {
uint64_t key[4][2];
/* Cache line 2 */
- uint8_t data[0];
+ uint8_t data[];
};
#else
struct rte_bucket_4_16 {
@@ -58,7 +58,7 @@ struct rte_bucket_4_16 {
uint64_t key[4][2];
/* Cache line 2 */
- uint8_t data[0];
+ uint8_t data[];
};
#endif
@@ -43,7 +43,7 @@ struct rte_bucket_4_32 {
uint64_t key[4][4];
/* Cache line 3 */
- uint8_t data[0];
+ uint8_t data[];
};
#else
struct rte_bucket_4_32 {
@@ -58,7 +58,7 @@ struct rte_bucket_4_32 {
uint64_t key[4][4];
/* Cache line 3 */
- uint8_t data[0];
+ uint8_t data[];
};
#endif
@@ -40,7 +40,7 @@ struct rte_bucket_4_8 {
uint64_t key[4];
/* Cache line 1 */
- uint8_t data[0];
+ uint8_t data[];
};
#else
struct rte_bucket_4_8 {
@@ -54,7 +54,7 @@ struct rte_bucket_4_8 {
uint64_t key[4];
/* Cache line 1 */
- uint8_t data[0];
+ uint8_t data[];
};
#endif
@@ -154,7 +154,7 @@ struct rte_vhost_inflight_info_split {
uint16_t desc_num;
uint16_t last_inflight_io;
uint16_t used_idx;
- struct rte_vhost_inflight_desc_split desc[0];
+ struct rte_vhost_inflight_desc_split desc[];
};
struct rte_vhost_inflight_desc_packed {
@@ -181,7 +181,7 @@ struct rte_vhost_inflight_info_packed {
uint8_t used_wrap_counter;
uint8_t old_used_wrap_counter;
uint8_t padding[7];
- struct rte_vhost_inflight_desc_packed desc[0];
+ struct rte_vhost_inflight_desc_packed desc[];
};
struct rte_vhost_resubmit_desc {