[v2,4/4] app: examples: replace zero-length arrays with undimensioned ones

Message ID 20220602161324.1123926-5-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series clean up zero-length arrays |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build fail github build: failed

Commit Message

Bruce Richardson June 2, 2022, 4:13 p.m. UTC
  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>
---
 app/test/test_table_tables.c   | 2 +-
 examples/ip_reassembly/main.c  | 2 +-
 examples/ptpclient/ptpclient.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c
index 010dd5a794..26908e6112 100644
--- a/app/test/test_table_tables.c
+++ b/app/test/test_table_tables.c
@@ -53,7 +53,7 @@  struct rte_bucket_4_8 {
 	uint64_t next_valid;
 	uint64_t key[4];
 	/* Cache line 1 */
-	uint8_t data[0];
+	uint8_t data[];
 };
 
 #if RTE_TABLE_HASH_LRU_STRATEGY == 3
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 6e4c11c3c7..3ebf895aa0 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -126,7 +126,7 @@  struct mbuf_table {
 	uint32_t len;
 	uint32_t head;
 	uint32_t tail;
-	struct rte_mbuf *m_table[0];
+	struct rte_mbuf *m_table[];
 };
 
 struct rx_queue {
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index de799f698b..1f1c9c9c52 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -90,7 +90,7 @@  struct sync_msg {
 struct follow_up_msg {
 	struct ptp_header   hdr;
 	struct tstamp       precise_origin_tstamp;
-	uint8_t             suffix[0];
+	uint8_t             suffix[];
 } __rte_packed;
 
 struct delay_req_msg {
@@ -102,7 +102,7 @@  struct delay_resp_msg {
 	struct ptp_header    hdr;
 	struct tstamp        rx_tstamp;
 	struct port_id       req_port_id;
-	uint8_t              suffix[0];
+	uint8_t              suffix[];
 } __rte_packed;
 
 struct ptp_message {