From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 069F2A055C; Fri, 3 Jun 2022 13:17:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B43242BA6; Fri, 3 Jun 2022 13:16:40 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 05CFA42B9F for ; Fri, 3 Jun 2022 13:16:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654254999; x=1685790999; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wvqycJcpCrOGDjfS3XIxGW8pvRXiOx0u2FuexiJhX2M=; b=gnjUr979qoRVdHavb9Yw56DJtP1xW0Y0gTD69JDeFYUISsEvKNso+3i2 xsm6cwCe2G8I9kVf3AcY8fVjoMJ3w4nKXVpL10hdxuT+7n9JyNFFVpIr4 189wOcxUEDSOkA+l0m6IXXz/epyvGoy/aaz+uCehjSP2zDkH5HqZVpyz7 ePxVvJAoR0oL4YxZEW/DLvhdFsebklNwdr134FV9N78+Yl56zCWWlEOLi tXqbLf0rcvac9WD+Ly68xOIrmllNrEtCOdtC7ZMYTJqjcQU/D/iI2cctu 4L9u8xAvwAc92TV60TI0s5UycLTkCuhQ+0cRrLqsmiZO/heueJcbFYSZm Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="275031101" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="275031101" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 04:16:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="607356434" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com) ([10.237.222.171]) by orsmga008.jf.intel.com with ESMTP; 03 Jun 2022 04:16:37 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger , Hemant Agrawal Subject: [PATCH v4 4/4] app: examples: replace zero-length arrays with undimensioned ones Date: Fri, 3 Jun 2022 12:16:25 +0100 Message-Id: <20220603111625.562070-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220603111625.562070-1-bruce.richardson@intel.com> References: <20220602150834.643745-1-bruce.richardson@intel.com> <20220603111625.562070-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Morten Brørup Acked-by: Stephen Hemminger Acked-by: Hemant Agrawal --- 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