From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7F7C7A055C; Fri, 3 Jun 2022 13:16:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7C2742B89; Fri, 3 Jun 2022 13:16:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 9F63840694 for ; Fri, 3 Jun 2022 13:16:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654254993; x=1685790993; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vv8UqODd9txikV+Jg5W3tWlucolMhHTnA6MN6/Wkf/I=; b=YDwSbjtmnjFd2HeDjaCD83rdtHyqwG4N5tWGHQU3XBhstgnB0fZsL59n 9KQQXpk/5MFp8WJ8T1ZSx0CvSI9Mmi6EsGrtwb5ibjYoflMq8JZt+7K79 fMWcAdSQf+xEmiSysY+EXRxvS+1/RLBRWrkt8YnF6KONtbCRh4wCW0xv0 lUPNfW29Rde54fIpgmc45YL1R0RUfEmJGhZowvIsKFtP2yBSbP3gY+SAS IwHCG10PKNQVfFlfOdQROfERIb5J/WRKjdcvuGxQdeIIT4lLdBKxouPVC Umg3LiWHlwDya6mnYTz1A6jaBy9rSEL356KuTnSTPE6aPXC6Or9u333Dv w==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="275031082" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="275031082" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 04:16:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="607356390" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com) ([10.237.222.171]) by orsmga008.jf.intel.com with ESMTP; 03 Jun 2022 04:16:30 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson Subject: [PATCH v4 0/4] clean up zero-length arrays Date: Fri, 3 Jun 2022 12:16:21 +0100 Message-Id: <20220603111625.562070-1-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-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 patchset adds a coccinelle script to clean-up zero-length arrays in structures. The final patches are the result of running that script on the DPDK repository. V4: removed change from struct ipsec_encap_pdb in common/dpaax, which caused build errors V3: Fixed issues in mlx5 drivers: * fixed incorrect coccinelle replacement of 2-D zero-length arrays * undid removal of "0" in tx elts[] which caused issues with Werror-pedantic V2: rebased to fix apply conflict Bruce Richardson (4): cocci: add script for zero-length arrays in structs drivers: replace zero-length arrays with undimensioned ones lib: replace zero-length arrays with undimensioned ones app: examples: replace zero-length arrays with undimensioned ones app/test/test_table_tables.c | 2 +- devtools/cocci/zero_length_array.cocci | 21 +++++++++++++++++++ drivers/bus/dpaa/include/netcfg.h | 4 ++-- drivers/bus/vmbus/rte_vmbus_reg.h | 4 ++-- drivers/common/cnxk/roc_se.h | 2 +- drivers/common/dpaax/dpaax_iova_table.h | 2 +- drivers/common/mlx5/mlx5_prm.h | 10 ++++----- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 4 ++-- drivers/crypto/virtio/virtio_ring.h | 4 ++-- drivers/crypto/virtio/virtqueue.h | 2 +- drivers/net/atlantic/hw_atl/hw_atl_utils.h | 2 +- drivers/net/cxgbe/clip_tbl.h | 2 +- drivers/net/cxgbe/l2t.h | 2 +- drivers/net/cxgbe/mps_tcam.h | 2 +- drivers/net/cxgbe/smt.h | 2 +- drivers/net/enic/base/vnic_devcmd.h | 2 +- drivers/net/hinic/hinic_pmd_tx.h | 2 +- drivers/net/nfp/nfpcore/nfp_nsp.h | 2 +- drivers/net/virtio/virtio_ring.h | 4 ++-- drivers/net/virtio/virtio_user/vhost_kernel.c | 2 +- drivers/net/virtio/virtio_user/vhost_vdpa.c | 2 +- drivers/net/virtio/virtqueue.h | 2 +- drivers/regex/mlx5/mlx5_rxp.h | 4 ++-- examples/ip_reassembly/main.c | 2 +- examples/ptpclient/ptpclient.c | 4 ++-- 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 ++-- 37 files changed, 73 insertions(+), 52 deletions(-) create mode 100644 devtools/cocci/zero_length_array.cocci -- 2.34.1