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 3C2B8A0548; Thu, 2 Jun 2022 18:14:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A4514281A; Thu, 2 Jun 2022 18:13:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 41F7842B70 for ; Thu, 2 Jun 2022 18:13:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654186433; x=1685722433; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vWxmTozyS8qyWx/rBk1jZizBuhxiM/XVssBzuxbc1tA=; b=MobZxvpdZvVMiJ85OCZzWX4aWdf+Tz8pUfiVVvc7nwc3i61csMikgWO/ NC8q9zzVrdkQOW1a0Jd/Ft3Fcth00eZmZQ94zXxA4C1ktgG7qNxTCD6JL har6ULawGg1PpKVo6JcScf0QMJ+csPPvLDmEjS4gJTphYfUIJIAxJeS5o w8meRTAQM73L3IH8W28pZHn9TMuqNbEAgFc+mBwXpB37Bi5zDztASRAtS 9/kd/+QKWhBMHV3reXL7cERhxXLWUlI97j53cTLNa/NqPNFH35B2T8Ixc ocpE26mKAV5ljhK/jf1Ad+xXhxnA5Uln3XyzpBdZrw64nDWvazqNa8l6D g==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="339040530" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339040530" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 09:13:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="577575069" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.222.171]) by orsmga007.jf.intel.com with ESMTP; 02 Jun 2022 09:13:51 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger Subject: [PATCH v2 4/4] app: examples: replace zero-length arrays with undimensioned ones Date: Thu, 2 Jun 2022 17:13:24 +0100 Message-Id: <20220602161324.1123926-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602161324.1123926-1-bruce.richardson@intel.com> References: <20220602150834.643745-1-bruce.richardson@intel.com> <20220602161324.1123926-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 --- 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