Skip to content

clean up zero-length arrays

Bruce Richardson dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 2 repliesIn review
  2. v34 patches 3 repliesSuperseded
  3. v24 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches5 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cocci: add script for zero-length arrays in structsdevtools/cocci/zero_length_array.cocci+21 -00 replies
2/4drivers: replace zero-length arrays with undimensioned onesdrivers/bus/dpaa/include/netcfg.h drivers/bus/vmbus/rte_vmbus_reg.h drivers/common/cnxk/roc_se.h +18 more+31 -310 replies
3/4lib: replace zero-length arrays with undimensioned oneslib/cryptodev/cryptodev_pmd.h lib/cryptodev/rte_cryptodev.h lib/eventdev/rte_event_timer_adapter.h +9 more+17 -170 replies
4/4app: examples: replace zero-length arrays with undimensioned onesapp/test/test_table_tables.c examples/ip_reassembly/main.c examples/ptpclient/ptpclient.c+4 -40 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMorten BrørupStephen HemmingerHemant AgrawalTyler Retzlaff
SeriesSeries-acked-by
1/4A-b A-b A-b
2/4A-b A-b A-b
3/4A-b A-b A-b
4/4A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] clean up zero-length arrays

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