Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/112270/?format=api
http://patches.dpdk.org/api/patches/112270/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220602150834.643745-4-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220602150834.643745-4-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220602150834.643745-4-bruce.richardson@intel.com", "date": "2022-06-02T15:08:33", "name": "[3/4] lib: replace zero-length arrays with undimensioned ones", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8dcc5e8d862defc16fe73c98e75b98f9585e1586", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220602150834.643745-4-bruce.richardson@intel.com/mbox/", "series": [ { "id": 23307, "url": "http://patches.dpdk.org/api/series/23307/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23307", "date": "2022-06-02T15:08:30", "name": "clean up zero-length arrays", "version": 1, "mbox": "http://patches.dpdk.org/series/23307/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/112270/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/112270/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 656D0A0548;\n\tThu, 2 Jun 2022 17:09:34 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6255D4281E;\n\tThu, 2 Jun 2022 17:09:26 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 88CBD40DF7\n for <dev@dpdk.org>; Thu, 2 Jun 2022 17:09:24 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Jun 2022 08:09:21 -0700", "from silpixa00401385.ir.intel.com (HELO\n silpixa00401385.ger.corp.intel.com.) ([10.237.222.171])\n by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 08:08:54 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1654182564; x=1685718564;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=av/rozJn0mmGGc00of4JpeVydzwhRexwpB/pRoFNwyM=;\n b=d9J2tmwtGimBhCw22HWNqzNQHXiF0FLNeTq8rzAZkvyNMQVhOiPnWavT\n 9HJNmaR+H4Gxf1M92EC3usxdN5u7tAE1w4Z7TcclMUH8hTh19accbgR0b\n QisScqR/b01YVL+PZFdJCjZ+yr/CBaGkdr5jGyVvPhLyMKU2m0rYJf1yh\n yPkPbtVzUaec2AP2ma0QyXP9BjV5A4H9R1i1A74bE1O4uDUiVWaGocGEy\n kormn+sDcNCP9DNrINxrBzfVTz7bvKIiBOtuzK90L2doteGi+WwG3mmlI\n yTR7GLKunx7fFx1hmhIDFc6oYWg0bAGGzuoRWRx6BfEKGc7N7Y5dhmzCz Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10365\"; a=\"301343813\"", "E=Sophos;i=\"5.91,271,1647327600\"; d=\"scan'208\";a=\"301343813\"", "E=Sophos;i=\"5.91,271,1647327600\"; d=\"scan'208\";a=\"905026030\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "david.marchand@redhat.com, stephen@networkplumber.org,\n Bruce Richardson <bruce.richardson@intel.com>", "Subject": "[PATCH 3/4] lib: replace zero-length arrays with undimensioned ones", "Date": "Thu, 2 Jun 2022 16:08:33 +0100", "Message-Id": "<20220602150834.643745-4-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20220602150834.643745-1-bruce.richardson@intel.com>", "References": "<20220602150834.643745-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "This patch replaces instances of zero-sized arrays i.e. those at the end\nof structures with \"[0]\" with the more standard syntax of \"[]\".\nReplacement was done using coccinelle script, with some cleanup of\nwhitespace afterwards.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/cryptodev/cryptodev_pmd.h | 2 +-\n lib/cryptodev/rte_cryptodev.h | 2 +-\n lib/eventdev/rte_event_timer_adapter.h | 2 +-\n lib/ip_frag/ip_reassembly.h | 2 +-\n lib/ipsec/sa.h | 2 +-\n lib/rib/rte_rib.c | 2 +-\n lib/rib/rte_rib6.c | 2 +-\n lib/table/rte_swx_table_learner.c | 4 ++--\n lib/table/rte_table_hash_key16.c | 4 ++--\n lib/table/rte_table_hash_key32.c | 4 ++--\n lib/table/rte_table_hash_key8.c | 4 ++--\n lib/vhost/rte_vhost.h | 4 ++--\n 13 files changed, 43 insertions(+), 17 deletions(-)\n create mode 100644 lib/count_comments.py\n\n--\n2.34.1", "diff": "diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h\nindex 2b1ce2da2d..9bcaa2f1c8 100644\n--- a/lib/cryptodev/cryptodev_pmd.h\n+++ b/lib/cryptodev/cryptodev_pmd.h\n@@ -637,7 +637,7 @@ RTE_STD_C11 struct rte_cryptodev_asym_session {\n \tuint16_t user_data_sz;\n \t/**< Session user data will be placed after sess_data */\n \tuint8_t padding[3];\n-\tuint8_t sess_private_data[0];\n+\tuint8_t sess_private_data[];\n };\n\n #ifdef __cplusplus\ndiff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h\nindex 45d33f4a50..089a27407a 100644\n--- a/lib/cryptodev/rte_cryptodev.h\n+++ b/lib/cryptodev/rte_cryptodev.h\n@@ -912,7 +912,7 @@ struct rte_cryptodev_sym_session {\n \t__extension__ struct {\n \t\tvoid *data;\n \t\tuint16_t refcnt;\n-\t} sess_data[0];\n+\t} sess_data[];\n \t/**< Driver specific session material, variable size */\n };\n\ndiff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h\nindex 4c91e5516a..eab8e59a57 100644\n--- a/lib/eventdev/rte_event_timer_adapter.h\n+++ b/lib/eventdev/rte_event_timer_adapter.h\n@@ -486,7 +486,7 @@ struct rte_event_timer {\n \t */\n \tenum rte_event_timer_state state;\n \t/**< State of the event timer. */\n-\tuint8_t user_meta[0];\n+\tuint8_t user_meta[];\n \t/**< Memory to store user specific metadata.\n \t * The event timer adapter implementation should not modify this area.\n \t */\ndiff --git a/lib/ip_frag/ip_reassembly.h b/lib/ip_frag/ip_reassembly.h\nindex 416fb66dd4..ef9d8c0d75 100644\n--- a/lib/ip_frag/ip_reassembly.h\n+++ b/lib/ip_frag/ip_reassembly.h\n@@ -83,7 +83,7 @@ struct rte_ip_frag_tbl {\n \tstruct ip_frag_pkt *last; /* last used entry. */\n \tstruct ip_pkt_list lru; /* LRU list for table entries. */\n \tstruct ip_frag_tbl_stat stat; /* statistics counters. */\n-\t__extension__ struct ip_frag_pkt pkt[0]; /* hash table. */\n+\t__extension__ struct ip_frag_pkt pkt[]; /* hash table. */\n };\n\n #endif /* _IP_REASSEMBLY_H_ */\ndiff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h\nindex 46f9a4df5b..ce4af8ceb2 100644\n--- a/lib/ipsec/sa.h\n+++ b/lib/ipsec/sa.h\n@@ -59,7 +59,7 @@ union sym_op_data {\n struct replay_sqn {\n \trte_rwlock_t rwl;\n \tuint64_t sqn;\n-\t__extension__ uint64_t window[0];\n+\t__extension__ uint64_t window[];\n };\n\n /*IPSEC SA supported algorithms */\ndiff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c\nindex f1fdddbbb4..b0794edf66 100644\n--- a/lib/rib/rte_rib.c\n+++ b/lib/rib/rte_rib.c\n@@ -35,7 +35,7 @@ struct rte_rib_node {\n \tuint8_t\t\tdepth;\n \tuint8_t\t\tflag;\n \tuint64_t\tnh;\n-\t__extension__ uint64_t\text[0];\n+\t__extension__ uint64_t ext[];\n };\n\n struct rte_rib {\ndiff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c\nindex 650bf1b8f6..19e4ff97c4 100644\n--- a/lib/rib/rte_rib6.c\n+++ b/lib/rib/rte_rib6.c\n@@ -34,7 +34,7 @@ struct rte_rib6_node {\n \tuint8_t\t\t\tip[RTE_RIB6_IPV6_ADDR_SIZE];\n \tuint8_t\t\t\tdepth;\n \tuint8_t\t\t\tflag;\n-\t__extension__ uint64_t\t\text[0];\n+\t__extension__ uint64_t ext[];\n };\n\n struct rte_rib6 {\ndiff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c\nindex 222acfc962..f7f8e8aea9 100644\n--- a/lib/table/rte_swx_table_learner.c\n+++ b/lib/table/rte_swx_table_learner.c\n@@ -252,7 +252,7 @@ struct table_bucket {\n \tuint32_t sig[TABLE_KEYS_PER_BUCKET];\n \tuint8_t key_timeout_id[TABLE_KEYS_PER_BUCKET];\n \tuint8_t pad[TABLE_BUCKET_PAD_SIZE];\n-\tuint8_t key[0];\n+\tuint8_t key[];\n };\n\n struct table_params {\n@@ -317,7 +317,7 @@ struct table {\n \tuint8_t key_mask0[RTE_CACHE_LINE_SIZE];\n\n \t/* Table buckets. */\n-\tuint8_t buckets[0];\n+\tuint8_t buckets[];\n } __rte_cache_aligned;\n\n /* The timeout (in cycles) is stored in the table as a 32-bit value by truncating its least\ndiff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c\nindex ea8195dc17..04d7fd64bd 100644\n--- a/lib/table/rte_table_hash_key16.c\n+++ b/lib/table/rte_table_hash_key16.c\n@@ -43,7 +43,7 @@ struct rte_bucket_4_16 {\n \tuint64_t key[4][2];\n\n \t/* Cache line 2 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #else\n struct rte_bucket_4_16 {\n@@ -58,7 +58,7 @@ struct rte_bucket_4_16 {\n \tuint64_t key[4][2];\n\n \t/* Cache line 2 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #endif\n\ndiff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c\nindex 87f83ce6f5..88d8f69c72 100644\n--- a/lib/table/rte_table_hash_key32.c\n+++ b/lib/table/rte_table_hash_key32.c\n@@ -43,7 +43,7 @@ struct rte_bucket_4_32 {\n \tuint64_t key[4][4];\n\n \t/* Cache line 3 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #else\n struct rte_bucket_4_32 {\n@@ -58,7 +58,7 @@ struct rte_bucket_4_32 {\n \tuint64_t key[4][4];\n\n \t/* Cache line 3 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #endif\n\ndiff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c\nindex 7779a9d1a3..035d242769 100644\n--- a/lib/table/rte_table_hash_key8.c\n+++ b/lib/table/rte_table_hash_key8.c\n@@ -40,7 +40,7 @@ struct rte_bucket_4_8 {\n \tuint64_t key[4];\n\n \t/* Cache line 1 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #else\n struct rte_bucket_4_8 {\n@@ -54,7 +54,7 @@ struct rte_bucket_4_8 {\n \tuint64_t key[4];\n\n \t/* Cache line 1 */\n-\tuint8_t data[0];\n+\tuint8_t data[];\n };\n #endif\n\ndiff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h\nindex c733f857c6..99be18ceef 100644\n--- a/lib/vhost/rte_vhost.h\n+++ b/lib/vhost/rte_vhost.h\n@@ -154,7 +154,7 @@ struct rte_vhost_inflight_info_split {\n \tuint16_t desc_num;\n \tuint16_t last_inflight_io;\n \tuint16_t used_idx;\n-\tstruct rte_vhost_inflight_desc_split desc[0];\n+\tstruct rte_vhost_inflight_desc_split desc[];\n };\n\n struct rte_vhost_inflight_desc_packed {\n@@ -181,7 +181,7 @@ struct rte_vhost_inflight_info_packed {\n \tuint8_t used_wrap_counter;\n \tuint8_t old_used_wrap_counter;\n \tuint8_t padding[7];\n-\tstruct rte_vhost_inflight_desc_packed desc[0];\n+\tstruct rte_vhost_inflight_desc_packed desc[];\n };\n\n struct rte_vhost_resubmit_desc {\n", "prefixes": [ "3/4" ] }{ "id": 112270, "url": "