common/iavf: replace zero-length arrays with flexible ones

Message ID tencent_7D3A7A9D44570652650B9D5ED095956C4306@qq.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers
Series common/iavf: replace zero-length arrays with flexible ones |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing fail build patch failure
ci/Intel-compilation fail Compilation issues
ci/github-robot: build fail github build: failed

Commit Message

biggest dreamer June 15, 2022, 5:26 p.m. UTC
  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.

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(-)
  

Comments

Qi Zhang June 28, 2022, 7:45 a.m. UTC | #1
> -----Original Message-----
> From: 835703180@qq.com <835703180@qq.com>
> Sent: Thursday, June 16, 2022 1:26 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Shiqi Liu <835703180@qq.com>
> Subject: [PATCH] common/iavf: replace zero-length arrays with flexible ones
> 
> 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.
> 
> Signed-off-by: Shiqi Liu <835703180@qq.com>

Nacked for compile issue reported in patchwork
https://patchwork.dpdk.org/project/dpdk/patch/tencent_7D3A7A9D44570652650B9D5ED095956C4306@qq.com/
  

Patch

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;