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 40E95A00C5; Wed, 16 Feb 2022 00:01:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08526410F7; Wed, 16 Feb 2022 00:01:03 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 32A78410F3 for ; Wed, 16 Feb 2022 00:01:02 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id z21so439211pgn.0 for ; Tue, 15 Feb 2022 15:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xEYgkyKgV3Y1+9gbhMosjrIU3qxH64Yu0zfAGBDxw0g=; b=2eYNzs54XpEcr84PISxkHE+AQn+vDQF0dZhc4lqT5s/lrkz6i/WPwNFRzgEtY2MplP Xa5W67xJzEYK1nz/HMp+Z/MXHl+zUT+jC5wRcUDnAPXHO+NsDQZB5puPxrLv3nsjOs3J lIY2LqpBrzkM5VFdq7+lmjJ3aTzyCV2WOYIdRYfzvAL4pKuFmN0qHhZ++cm+cPGB1hfJ lsnc9CjaQIJsRPRFaptH5CzN28KZzzbDr+TA+tBPu+tH81+WaNTAyxaVl4tpGZ7Dd1Bn Aa3avpyjVcc4hxPYHKLXE9Saym10d/rsqJOC71ts6e4LurdonppKV1XyUa22n1CtdQCz ktgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xEYgkyKgV3Y1+9gbhMosjrIU3qxH64Yu0zfAGBDxw0g=; b=Qf7rGuar8beGKFlEQUzBufibM7wz+fJ6CwtI8xsIx0jvyl+rg5zhkRRt/Jw8aS4UxS LVPYq/S1BpaMKCqrlabaPf70808h5x77REHcOv3tJ2uExUG++fCNLAlafPxn4qrCeSFD XPDB9ZgAElkfwD3NFiIXl/B82AkgeHh9vqbghcqJqzW6JyWWICKqJpGsgoc7jsAUpvAU TFMAI9tgoxVdWWxQXarkPz98Yf9+FAVCzeA4iT60yyYqCOIGv3Gq0jVVDYaNjQXHVxVy HNmD3q5yKb3JvA3Zso3pAaAcj2UvDVWU06XIWl4c2RnQQ2z0dTsmaL1jgQMP+I2Wdnry wQyg== X-Gm-Message-State: AOAM533WVmzWbHBAp2oMd6+FlQ/IRtwoJjLBMF1HAzpRPkitNsS8RtIX wSJAmS3JsPudvtqk9syeGB1tdf5BjUkh6GJW X-Google-Smtp-Source: ABdhPJxWT6WkEnFivdsssYoIKqYWVD+7yZNpdTNnJvN4OwKwt1vs3fQF2ZuLeSJifPXi9sFjGgltVA== X-Received: by 2002:a05:6a00:847:: with SMTP id q7mr1163226pfk.0.1644966060887; Tue, 15 Feb 2022 15:01:00 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id h25sm38204574pfn.208.2022.02.15.15.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 15:01:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [RFC 0/2] Eliminate zero length arrays in DPDK Date: Tue, 15 Feb 2022 15:00:56 -0800 Message-Id: <20220215230058.64760-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Yet another case of applying Linux kernel best practices to DPDK. Flexible arrays are supported by Clang, GCC and Microsoft compilers (part of C99). Stephen Hemminger (2): devtools: add script to check for zero length array treewide: replace zero-length array with flex array app/test/test_table_tables.c | 2 +- devtools/cocci/zerolengtharray.cocci | 17 +++++++++++++++++ drivers/bus/dpaa/include/netcfg.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 | 8 ++++---- drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 4 ++-- drivers/crypto/virtio/virtio_ring.h | 4 ++-- drivers/crypto/virtio/virtqueue.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 | 4 ++-- 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 | 2 +- examples/ip_reassembly/main.c | 2 +- lib/cryptodev/cryptodev_pmd.h | 2 +- lib/cryptodev/rte_cryptodev.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 | 2 +- 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 ++-- 35 files changed, 63 insertions(+), 46 deletions(-) create mode 100644 devtools/cocci/zerolengtharray.cocci -- 2.34.1