DPDK patches and discussions
 help / color / mirror / Atom feed
From: 835703180@qq.com
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, Shiqi Liu <835703180@qq.com>
Subject: [V2] common/iavf:replace zero-length arrays with flexible ones
Date: Thu, 16 Jun 2022 01:42:18 +0800	[thread overview]
Message-ID: <tencent_9399CA173AA42027ABE40647F44809AA8C07@qq.com> (raw)

From: Shiqi Liu <835703180@qq.com>

        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 revert and
        cleanup of whitespace afterwards.
	v2:
	* revise a error with BRACKET_SPACE

Signed-off-by: Shiqi Liu <835703180@qq.com>
---
 ...ace-zero-length-arrays-with-flexible.patch | 76 +++++++++++++++++++
 drivers/common/iavf/virtchnl_inline_ipsec.h   |  2 +-
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 0001-common-iavf-replace-zero-length-arrays-with-flexible.patch

diff --git a/0001-common-iavf-replace-zero-length-arrays-with-flexible.patch b/0001-common-iavf-replace-zero-length-arrays-with-flexible.patch
new file mode 100644
index 0000000000..25c5658791
--- /dev/null
+++ b/0001-common-iavf-replace-zero-length-arrays-with-flexible.patch
@@ -0,0 +1,76 @@
+From e680b5d91aad9e22d45652efdd85cd2c40105247 Mon Sep 17 00:00:00 2001
+From: Shiqi Liu <835703180@qq.com>
+Date: Thu, 16 Jun 2022 01:12:47 +0800
+Subject: [PATCH] common/iavf: replace zero-length arrays with flexible ones
+
+    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 revert and
+    cleanup of whitespace afterwards.
+
+Signed-off-by: Shiqi Liu <835703180@qq.com>
+---
+ drivers/common/iavf/virtchnl_inline_ipsec.h | 24 ++++++++++-----------
+ drivers/common/mlx5/mlx5_prm.h              |  4 ++--
+ 2 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/common/iavf/virtchnl_inline_ipsec.h b/drivers/common/iavf/virtchnl_inline_ipsec.h
+index 2f4bf15725..9d5c433d32 100644
+--- a/drivers/common/iavf/virtchnl_inline_ipsec.h
++++ b/drivers/common/iavf/virtchnl_inline_ipsec.h
+@@ -500,25 +500,25 @@ struct inline_ipsec_msg {
+ 
+ 	union {
+ 		/* IPsec request */
+-		struct virtchnl_ipsec_sa_cfg sa_cfg[0];
+-		struct virtchnl_ipsec_sp_cfg sp_cfg[0];
+-		struct virtchnl_ipsec_sa_update sa_update[0];
+-		struct virtchnl_ipsec_sa_destroy sa_destroy[0];
+-		struct virtchnl_ipsec_sp_destroy sp_destroy[0];
++		struct virtchnl_ipsec_sa_cfg sa_cfg[];
++		struct virtchnl_ipsec_sp_cfg sp_cfg[];
++		struct virtchnl_ipsec_sa_update sa_update [];
++		struct virtchnl_ipsec_sa_destroy sa_destroy[];
++		struct virtchnl_ipsec_sp_destroy sp_destroy[];
+ 
+ 		/* IPsec response */
+-		struct virtchnl_ipsec_sa_cfg_resp sa_cfg_resp[0];
+-		struct virtchnl_ipsec_sp_cfg_resp sp_cfg_resp[0];
+-		struct virtchnl_ipsec_cap ipsec_cap[0];
+-		struct virtchnl_ipsec_status ipsec_status[0];
++		struct virtchnl_ipsec_sa_cfg_resp sa_cfg_resp[];
++		struct virtchnl_ipsec_sp_cfg_resp sp_cfg_resp[];
++		struct virtchnl_ipsec_cap ipsec_cap[];
++		struct virtchnl_ipsec_status ipsec_status[];
+ 		/* response to del_sa, del_sp, update_sa */
+-		struct virtchnl_ipsec_resp ipsec_resp[0];
++		struct virtchnl_ipsec_resp ipsec_resp[];
+ 
+ 		/* IPsec event (no req_id is required) */
+-		struct virtchnl_ipsec_event event[0];
++		struct virtchnl_ipsec_event event[];
+ 
+ 		/* Reserved */
+-		struct virtchnl_ipsec_sa_read sa_read[0];
++		struct virtchnl_ipsec_sa_read sa_read[];
+ 	} ipsec_data;
+ } __rte_packed;
+ 
+diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
+index 654e5f44ee..c841d34216 100644
+--- a/drivers/common/mlx5/mlx5_prm.h
++++ b/drivers/common/mlx5/mlx5_prm.h
+@@ -552,8 +552,8 @@ struct mlx5_umr_wqe {
+ 	struct mlx5_wqe_umr_cseg ucseg;
+ 	struct mlx5_wqe_mkey_cseg mkc;
+ 	union {
+-		struct mlx5_wqe_dseg kseg[0];
+-		struct mlx5_wqe_umr_bsf_seg bsf[0];
++		struct mlx5_wqe_dseg kseg[];
++		struct mlx5_wqe_umr_bsf_seg bsf[];
+ 	};
+ } __rte_packed;
+ 
+-- 
+2.35.1.windows.2
+
diff --git a/drivers/common/iavf/virtchnl_inline_ipsec.h b/drivers/common/iavf/virtchnl_inline_ipsec.h
index 9d5c433d32..0781de1fe1 100644
--- a/drivers/common/iavf/virtchnl_inline_ipsec.h
+++ b/drivers/common/iavf/virtchnl_inline_ipsec.h
@@ -502,7 +502,7 @@ struct inline_ipsec_msg {
 		/* IPsec request */
 		struct virtchnl_ipsec_sa_cfg sa_cfg[];
 		struct virtchnl_ipsec_sp_cfg sp_cfg[];
-		struct virtchnl_ipsec_sa_update sa_update [];
+		struct virtchnl_ipsec_sa_update sa_update[];
 		struct virtchnl_ipsec_sa_destroy sa_destroy[];
 		struct virtchnl_ipsec_sp_destroy sp_destroy[];
 
-- 
2.35.1.windows.2


             reply	other threads:[~2022-06-15 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 17:42 835703180 [this message]
2022-06-19 12:08 ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_9399CA173AA42027ABE40647F44809AA8C07@qq.com \
    --to=835703180@qq.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).