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 8ED7CC433EF for ; Thu, 2 Jun 2022 15:35:15 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEDF640691; Thu, 2 Jun 2022 17:35:14 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id DB8C34021E for ; Thu, 2 Jun 2022 17:35:13 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id r71so5088042pgr.0 for ; Thu, 02 Jun 2022 08:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uDsgdvbszVBBHF+pQqj61KdiYd4f5bkS7+8ECOt9ugo=; b=VD/T1+6A0cyKd64e4nJ8y2lo83ORsVeGgNgE5XoZgXxFGSadPsH7Cs50Rgwkn4yUjb fJMMQfaPTt8tXNRFx6nBM44oFtfvXi9CS8TK4hqYHH8OOlHA8ZWc5uu06Z4y8zHz07Ib 8I885KWjq0f5OZ2dy0mAzLAawPzTnR3apoApSIYbt361cJ2daezLdtmj3IKv5oF2qNAp 9VYPjz42zdXA6VMT/QV6VbKRmWsD5X9/r4X3gVyM9En5K72MGJMIc5in8v42BWFECaCK mYZs9Ike37Fua+XPY9JSYNWePRebkaixbfeC4KKB1OnGaHhQ2oOZRAW4rT5tn2dL95uc 9fLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uDsgdvbszVBBHF+pQqj61KdiYd4f5bkS7+8ECOt9ugo=; b=COPZctIkaGsqBJFoj9/DTZHS9wv4f9XRnXzsolXXx4FsDAF6nh3LBC77DxX7MKP8t0 8LEMwOVX79a14bvqOvPuaFPk5I2+11IFy9Jz6oUeu5gptHHd+dEL529stowNd0C7hyrS R6Q1Z0b2LOsOmZwIV0kDUh+wii4QIvSBd65hjS7NV4Txz7MI+gvtPB0BhlERai53EgFx AgH+li6Mn2C7iswGZB4AeI244Irqrg9yjS+4wU/Q4lfynqqFk4OTy5GyqW3AveiTps2g SDcbbU0eJIVczfKr4ST/AlRs77xSAaumEKo/a52KJzzmidYYpUB8BI6kociDyJVPuuVl yuSw== X-Gm-Message-State: AOAM532y9J46/vmACSuBVbxLGHeNUlkQPzhfzE5xOmqLJaXZjyBiHKer /VpqnPrrUDjeXAPOxOwVCcPifw== X-Google-Smtp-Source: ABdhPJwiHJkrF3hBmcLLAxCuUbd5zCao3uKlzxSt6RgPAzLNZLKzYqVWKRJDHR+5hmkp7nnscOHnsw== X-Received: by 2002:a05:6a00:98b:b0:51b:d730:c58 with SMTP id u11-20020a056a00098b00b0051bd7300c58mr1423869pfg.23.1654184112993; Thu, 02 Jun 2022 08:35:12 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id fz21-20020a17090b025500b001df51e34036sm3538543pjb.0.2022.06.02.08.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 08:35:12 -0700 (PDT) Date: Thu, 2 Jun 2022 08:35:09 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, david.marchand@redhat.com Subject: Re: [PATCH 0/4] clean up zero-length arrays Message-ID: <20220602083509.1b71d418@hermes.local> 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=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 2 Jun 2022 16:08:30 +0100 Bruce Richardson wrote: > 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. > > 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/caamflib/desc/ipsec.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/mlx5/mlx5_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 +-- > 40 files changed, 101 insertions(+), 54 deletions(-) > create mode 100644 devtools/cocci/zero_length_array.cocci > create mode 100644 lib/count_comments.py > > -- > 2.34.1 > Series-acked-by: Stephen Hemminger Would it be possible to add check for zero length arrays in checkpatch? So that new drivers don't bring the problem back.