From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0D24C43334 for ; Fri, 3 Jun 2022 10:14:13 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 819CF42B88; Fri, 3 Jun 2022 12:14:03 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id CC3EE42B8C for ; Fri, 3 Jun 2022 12:14:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654251242; x=1685787242; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EF5uSbBTnQ3EEv7dCPxfrJLtQq5eNSzU8pdQ/Fjqfcw=; b=CMwXMK73hapquuG9moYEgoMdjml5WEBpBBTAtf7Brx35yngb+81m6ot7 W/vsFug3eIF4tn43Kp6OKzgnF0SwvHROkPiBkZpivtaVv9eJ5QHQD1HnP lEFKyxFTljJ6MJilgvWHn5FLpv7B2cyuoZSmn3MiW3mfEtIlZNQssj5gp 98Vkj8SmA64K0M3dnpEhVYh9bDMuwn+OBKORkCTAggSzl2ttaD7gW6amR 0r2mjC2tPSjQNPurZH8l4KCinJdLuQG5WunzZTLpQeZ2qTN9w67RjQic0 w3IM8WPodigDsew9FqVzn61//k2ruO2TTzrpLrqZUQTwlZNnbCZUxZmWO g==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="273783822" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="273783822" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 03:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="530957241" Received: from silpixa00401026.ir.intel.com ([10.243.22.135]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2022 03:13:59 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=83=C2=B8rup?= , Stephen Hemminger , Hemant Agrawal Subject: [PATCH v3 4/4] app: examples: replace zero-length arrays with undimensioned ones Date: Fri, 3 Jun 2022 11:13:31 +0100 Message-Id: <20220603101331.1030993-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220603101331.1030993-1-bruce.richardson@intel.com> References: <20220602150834.643745-1-bruce.richardson@intel.com> <20220603101331.1030993-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