All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	"Hemant Agrawal" <hemant.agrawal@nxp.com>
Subject: [PATCH v3 4/4] app: examples: replace zero-length arrays with undimensioned ones
Date: Fri,  3 Jun 2022 11:13:31 +0100	[thread overview]
Message-ID: <20220603101331.1030993-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20220603101331.1030993-1-bruce.richardson@intel.com>

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>
---
 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(-)

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 {
-- 
2.34.1


  parent reply	other threads:[~2022-06-03 10:14 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:08 [PATCH 0/4] clean up zero-length arrays Bruce Richardson
2022-06-02 15:08 ` [PATCH 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-02 15:08 ` [PATCH 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-02 15:08 ` [PATCH 3/4] lib: " Bruce Richardson
2022-06-02 15:08 ` [PATCH 4/4] app: examples: " Bruce Richardson
2022-06-02 15:20 ` [PATCH 0/4] clean up zero-length arrays Morten Brørup
2022-06-02 15:35 ` Stephen Hemminger
2022-06-02 16:13 ` [PATCH v2 " Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03  7:19     ` David Marchand
2022-06-03  7:36       ` Bruce Richardson
2022-06-03  9:18       ` Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 3/4] lib: " Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 4/4] app: examples: " Bruce Richardson
2022-06-03  6:56   ` [PATCH v2 0/4] clean up zero-length arrays Hemant Agrawal
2022-06-03 10:13 ` [PATCH v3 " Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-03 10:30     ` Morten Brørup
2022-06-03 10:38       ` Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 3/4] lib: " Bruce Richardson
2022-06-03 10:13   ` Bruce Richardson [this message]
2022-06-03 11:13   ` [PATCH v3 0/4] clean up zero-length arrays Bruce Richardson
2022-06-03 11:16 ` [PATCH v4 " Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 3/4] lib: " Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 4/4] app: examples: " Bruce Richardson
2022-06-07 14:16   ` [PATCH v4 0/4] clean up zero-length arrays David Marchand
2022-06-09 15:19   ` Tyler Retzlaff
2022-06-08 15:23 ` [PATCH " Stephen Hemminger
2022-06-14  9:40   ` Bruce Richardson
2022-06-14  9:45     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603101331.1030993-5-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.