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 17C26C433EF for ; Thu, 2 Jun 2022 16:14:01 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA69242B6C; Thu, 2 Jun 2022 18:13:52 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D96814021E for ; Thu, 2 Jun 2022 18:13:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654186431; x=1685722431; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pHX2fCSVLsgKnl9oO5oNknUG5ujZMyfAMAe8TCVVxeA=; b=J0EHtwhU5VjWW2NiLmjINLKY9qylClhT/b673QJ9MgiZRDuPKOW9e/ww cfSu7TQ6HaNlof4bIGkucJkGuCDsedtguhCzUxsRydIThanAwejrJ16LG /RDlGWV5N9Z3qssQw6JqGJFO0IaOk7rdJSfUDNmfMlMlCJXDGOAO5Hclf yGo+ZznCvAvBcmH1XPdsVvITBy6nzrQbb7AhPFF6jSWft6yp0uNVRxG6k Ing13VJvx/zQ5L7pnRaSri4xAOmg3jD1s65zoXcIVAQzgPyjTZ+xiNBvA DV6nsmQ6Xdn4bT3xzICvLXOYZN9lxf9n9Vhdor0IgIXDzRKyCMtXcEHiL w==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="339040523" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339040523" 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:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="577575059" 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:48 -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 3/4] lib: replace zero-length arrays with undimensioned ones Date: Thu, 2 Jun 2022 17:13:23 +0100 Message-Id: <20220602161324.1123926-4-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 --- lib/cryptodev/cryptodev_pmd.h | 2 +- lib/cryptodev/rte_cryptodev.h | 2 +- lib/eventdev/rte_event_timer_adapter.h | 2 +- lib/ip_frag/ip_reassembly.h | 2 +- lib/ipsec/sa.h | 2 +- lib/rib/rte_rib.c | 2 +- lib/rib/rte_rib6.c | 2 +- lib/table/rte_swx_table_learner.c | 4 ++-- lib/table/rte_table_hash_key16.c | 4 ++-- lib/table/rte_table_hash_key32.c | 4 ++-- lib/table/rte_table_hash_key8.c | 4 ++-- lib/vhost/rte_vhost.h | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index 7a7d3ee3f1..3dcc3cb7ed 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -673,7 +673,7 @@ RTE_STD_C11 struct rte_cryptodev_asym_session { uint8_t padding[3]; void *event_mdata; /**< Event metadata (aka *union rte_event_crypto_metadata*) */ - uint8_t sess_private_data[0]; + uint8_t sess_private_data[]; }; #ifdef __cplusplus diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 585cee2727..56f459c6a0 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -918,7 +918,7 @@ struct rte_cryptodev_sym_session { __extension__ struct { void *data; uint16_t refcnt; - } sess_data[0]; + } sess_data[]; /**< Driver specific session material, variable size */ }; diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h index 4c91e5516a..eab8e59a57 100644 --- a/lib/eventdev/rte_event_timer_adapter.h +++ b/lib/eventdev/rte_event_timer_adapter.h @@ -486,7 +486,7 @@ struct rte_event_timer { */ enum rte_event_timer_state state; /**< State of the event timer. */ - uint8_t user_meta[0]; + uint8_t user_meta[]; /**< Memory to store user specific metadata. * The event timer adapter implementation should not modify this area. */ diff --git a/lib/ip_frag/ip_reassembly.h b/lib/ip_frag/ip_reassembly.h index 416fb66dd4..ef9d8c0d75 100644 --- a/lib/ip_frag/ip_reassembly.h +++ b/lib/ip_frag/ip_reassembly.h @@ -83,7 +83,7 @@ struct rte_ip_frag_tbl { struct ip_frag_pkt *last; /* last used entry. */ struct ip_pkt_list lru; /* LRU list for table entries. */ struct ip_frag_tbl_stat stat; /* statistics counters. */ - __extension__ struct ip_frag_pkt pkt[0]; /* hash table. */ + __extension__ struct ip_frag_pkt pkt[]; /* hash table. */ }; #endif /* _IP_REASSEMBLY_H_ */ diff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h index 46f9a4df5b..ce4af8ceb2 100644 --- a/lib/ipsec/sa.h +++ b/lib/ipsec/sa.h @@ -59,7 +59,7 @@ union sym_op_data { struct replay_sqn { rte_rwlock_t rwl; uint64_t sqn; - __extension__ uint64_t window[0]; + __extension__ uint64_t window[]; }; /*IPSEC SA supported algorithms */ diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index f1fdddbbb4..b0794edf66 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -35,7 +35,7 @@ struct rte_rib_node { uint8_t depth; uint8_t flag; uint64_t nh; - __extension__ uint64_t ext[0]; + __extension__ uint64_t ext[]; }; struct rte_rib { diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index 650bf1b8f6..19e4ff97c4 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -34,7 +34,7 @@ struct rte_rib6_node { uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE]; uint8_t depth; uint8_t flag; - __extension__ uint64_t ext[0]; + __extension__ uint64_t ext[]; }; struct rte_rib6 { diff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c index 222acfc962..f7f8e8aea9 100644 --- a/lib/table/rte_swx_table_learner.c +++ b/lib/table/rte_swx_table_learner.c @@ -252,7 +252,7 @@ struct table_bucket { uint32_t sig[TABLE_KEYS_PER_BUCKET]; uint8_t key_timeout_id[TABLE_KEYS_PER_BUCKET]; uint8_t pad[TABLE_BUCKET_PAD_SIZE]; - uint8_t key[0]; + uint8_t key[]; }; struct table_params { @@ -317,7 +317,7 @@ struct table { uint8_t key_mask0[RTE_CACHE_LINE_SIZE]; /* Table buckets. */ - uint8_t buckets[0]; + uint8_t buckets[]; } __rte_cache_aligned; /* The timeout (in cycles) is stored in the table as a 32-bit value by truncating its least diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c index ea8195dc17..04d7fd64bd 100644 --- a/lib/table/rte_table_hash_key16.c +++ b/lib/table/rte_table_hash_key16.c @@ -43,7 +43,7 @@ struct rte_bucket_4_16 { uint64_t key[4][2]; /* Cache line 2 */ - uint8_t data[0]; + uint8_t data[]; }; #else struct rte_bucket_4_16 { @@ -58,7 +58,7 @@ struct rte_bucket_4_16 { uint64_t key[4][2]; /* Cache line 2 */ - uint8_t data[0]; + uint8_t data[]; }; #endif diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c index 87f83ce6f5..88d8f69c72 100644 --- a/lib/table/rte_table_hash_key32.c +++ b/lib/table/rte_table_hash_key32.c @@ -43,7 +43,7 @@ struct rte_bucket_4_32 { uint64_t key[4][4]; /* Cache line 3 */ - uint8_t data[0]; + uint8_t data[]; }; #else struct rte_bucket_4_32 { @@ -58,7 +58,7 @@ struct rte_bucket_4_32 { uint64_t key[4][4]; /* Cache line 3 */ - uint8_t data[0]; + uint8_t data[]; }; #endif diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c index 7779a9d1a3..035d242769 100644 --- a/lib/table/rte_table_hash_key8.c +++ b/lib/table/rte_table_hash_key8.c @@ -40,7 +40,7 @@ struct rte_bucket_4_8 { uint64_t key[4]; /* Cache line 1 */ - uint8_t data[0]; + uint8_t data[]; }; #else struct rte_bucket_4_8 { @@ -54,7 +54,7 @@ struct rte_bucket_4_8 { uint64_t key[4]; /* Cache line 1 */ - uint8_t data[0]; + uint8_t data[]; }; #endif diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h index c733f857c6..99be18ceef 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -154,7 +154,7 @@ struct rte_vhost_inflight_info_split { uint16_t desc_num; uint16_t last_inflight_io; uint16_t used_idx; - struct rte_vhost_inflight_desc_split desc[0]; + struct rte_vhost_inflight_desc_split desc[]; }; struct rte_vhost_inflight_desc_packed { @@ -181,7 +181,7 @@ struct rte_vhost_inflight_info_packed { uint8_t used_wrap_counter; uint8_t old_used_wrap_counter; uint8_t padding[7]; - struct rte_vhost_inflight_desc_packed desc[0]; + struct rte_vhost_inflight_desc_packed desc[]; }; struct rte_vhost_resubmit_desc { -- 2.34.1