Skip to content

replace snprintf with strlcpy

Stephen Hemminger dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest25 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25app: use strlcpy in testsapp/test-bbdev/main.c app/test-pmd/cmdline_flow.c app/test/process.h +1 more+22 -200 replies
2/25examples: use strlcpy instead of snprintfexamples/fips_validation/fips_validation.c examples/l3fwd-graph/main.c examples/pipeline/cli.c +1 more+8 -90 replies
3/25lib: use strlcpy instead of snprintflib/bbdev/rte_bbdev.c lib/ethdev/sff_8636.c+8 -50 replies
4/25raw/ifpga: replace snprintf with strlcpydrivers/raw/ifpga/afu_pmd_core.c+2 -11 reply
5/25common/cnxk: replace snprint with strlcpydrivers/common/cnxk/roc_nix_stats.c+1 -30 replies
6/25common/mlx5: replace snprintf with strlcpydrivers/common/mlx5/linux/mlx5_common_os.c drivers/common/mlx5/mlx5_common_utils.c+3 -40 replies
7/25drivers/gpu: replace snprintf with strlcpydrivers/gpu/cuda/cuda.c drivers/gpu/cuda/gdrcopy.c+2 -20 replies
8/25crypto/ipsec_mb: remove unnecessary snprintfdrivers/crypto/ipsec_mb/ipsec_mb_ops.c+1 -60 replies
9/25crypto/dpaa_sec: replace snprintf with strlcpydrivers/crypto/dpaa_sec/dpaa_sec.c+1 -11 reply
10/25event/cnxk: replace snprintf with strlcpydrivers/event/cnxk/cnxk_eventdev_stats.c+5 -60 replies
11/25net/atlantic: replace snprintf with strlcpydrivers/net/atlantic/atl_ethdev.c+2 -30 replies
12/25net/axgbe: replace snprintf with strlcpydrivers/net/axgbe/axgbe_ethdev.c+3 -30 replies
13/25net/bnxt: replace snprintf with strlcpydrivers/net/bnxt/bnxt_ethdev.c+4 -40 replies
14/25net/cpfl: replace snprintf with strlcpydrivers/net/cpfl/cpfl_ethdev.c+3 -30 replies
15/25net/cxgbe: replace snprintf with strlcpydrivers/net/cxgbe/cxgbe_ethdev.c+4 -50 replies
16/25net/dpaa*: replace snprintf with strlcpydrivers/net/dpaa/dpaa_ethdev.c drivers/net/dpaa2/dpaa2_ethdev.c+8 -81 reply
17/25net/hinic: replace snptintf with strlcpydrivers/net/hinic/base/hinic_compat.h drivers/net/hinic/base/hinic_pmd_niccfg.c drivers/net/hinic/hinic_pmd_ethdev.c+9 -100 replies
18/25net/hns3: replace snprint with strlcpydrivers/net/hns3/hns3_fdir.c drivers/net/hns3/hns3_rxtx.c drivers/net/hns3/hns3_stats.c+16 -160 replies
19/25net/intel: replace snprintf with strlcpydrivers/net/fm10k/fm10k_ethdev.c drivers/net/i40e/i40e_rxtx.c drivers/net/iavf/iavf_ethdev.c +3 more+20 -200 replies
20/25net/ionic: replace snprintf with strlcpydrivers/net/ionic/ionic_ethdev.c drivers/net/ipn3ke/ipn3ke_representor.c+14 -181 reply
21/25net/mlx5: replace snprintf with strlcpydrivers/net/mlx5/mlx5_rx.c+8 -80 replies
22/25net/nfp: replace snprintf with strlcpydrivers/net/nfp/flower/nfp_flower_representor.c+2 -21 reply
23/25net/ngbe: replace snprintf with strlcpydrivers/net/ngbe/ngbe_rxtx.c+4 -40 replies
24/25net/qede: replace snprintf with strlcpydrivers/net/qede/qede_ethdev.c+4 -60 replies
25/25net/txgbe: replace snprintf with strlcpydrivers/net/txgbe/txgbe_ethdev_vf.c+3 -30 replies

Reviews trailers per patch

5 of 25 patches have a Reviewed-by or Acked-by.

PatchHemant AgrawalRosen XuNiklas Söderlund
1/25
2/25
3/25
4/25R-b
5/25
6/25
7/25
8/25
9/25A-b
10/25
11/25
12/25
13/25
14/25
15/25
16/25A-b
17/25
18/25
19/25
20/25R-b
21/25
22/25R-b
23/25
24/25
25/25

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

Read the v1 thread

Cover letter [PATCH 00/25] replace snprintf with strlcpy

This patch series was generated by using the existing Coccinelle script to find where snprintf() is used but strlcpy() could be used instead.

Manually replaced fixed some trigraphs and paren's where needed. Also one instance the whole temporary string copy was not needed at all.

Stephen Hemminger (25):
app: use strlcpy in tests
examples: use strlcpy instead of snprintf
lib: use strlcpy instead of snprintf raw/ifpga: replace snprintf with strlcpy common/cnxk: replace snprint with strlcpy common/mlx5: replace snprintf with strlcpy drivers/gpu: replace snprintf with strlcpy crypto/ipsec_mb: remove unnecessary snprintf crypto/dpaa_sec: replace snprintf with strlcpy event/cnxk: replace snprintf with strlcpy net/atlantic: replace snprintf with strlcpy net/axgbe: replace snprintf with strlcpy net/bnxt: replace snprintf with strlcpy net/cpfl: replace snprintf with strlcpy net/cxgbe: replace snprintf with strlcpy net/dpaa*: replace snprintf with strlcpy net/hinic: replace snptintf with strlcpy net/hns3: replace snprint with strlcpy net/intel: replace snprintf with strlcpy net/ionic: replace snprintf with strlcpy net/mlx5: replace snprintf with strlcpy net/nfp: replace snprintf with strlcpy net/ngbe: replace snprintf with strlcpy net/qede: replace snprintf with strlcpy net/txgbe: replace snprintf with strlcpy

 app/test-bbdev/main.c                         |  5 ++--
 app/test-pmd/cmdline_flow.c                   |  6 ++--
 app/test/process.h                            |  2 +-
 app/test/test_graph_perf.c                    | 29 ++++++++++---------
 drivers/common/cnxk/roc_nix_stats.c           |  4 +--
 drivers/common/mlx5/linux/mlx5_common_os.c    |  2 +-
 drivers/common/mlx5/mlx5_common_utils.c       |  5 ++--
 drivers/crypto/dpaa_sec/dpaa_sec.c            |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c        |  7 +----
 drivers/event/cnxk/cnxk_eventdev_stats.c      | 11 ++++---
 drivers/gpu/cuda/cuda.c                       |  2 +-
 drivers/gpu/cuda/gdrcopy.c                    |  2 +-
 drivers/net/atlantic/atl_ethdev.c             |  5 ++--
 drivers/net/axgbe/axgbe_ethdev.c              |  6 ++--
 drivers/net/bnxt/bnxt_ethdev.c                |  8 ++---
 drivers/net/cpfl/cpfl_ethdev.c                |  6 ++--
 drivers/net/cxgbe/cxgbe_ethdev.c              |  9 +++---
 drivers/net/dpaa/dpaa_ethdev.c                |  8 ++---
 drivers/net/dpaa2/dpaa2_ethdev.c              |  8 ++---
 drivers/net/fm10k/fm10k_ethdev.c              |  6 ++--
 drivers/net/hinic/base/hinic_compat.h         |  1 +
 drivers/net/hinic/base/hinic_pmd_niccfg.c     |  4 +--
 drivers/net/hinic/hinic_pmd_ethdev.c          | 14 ++++-----
 drivers/net/hns3/hns3_fdir.c                  |  2 +-
 drivers/net/hns3/hns3_rxtx.c                  |  8 ++---
 drivers/net/hns3/hns3_stats.c                 | 22 +++++++-------
 drivers/net/i40e/i40e_rxtx.c                  |  8 ++---
 drivers/net/iavf/iavf_ethdev.c                |  6 ++--
 drivers/net/ice/ice_dcf_ethdev.c              |  6 ++--
 drivers/net/ice/ice_rxtx.c                    |  8 ++---
 drivers/net/idpf/idpf_ethdev.c                |  6 ++--
 drivers/net/ionic/ionic_ethdev.c              | 15 +++++-----
 drivers/net/ipn3ke/ipn3ke_representor.c       | 17 +++++------
 drivers/net/mlx5/mlx5_rx.c                    | 16 +++++-----
 .../net/nfp/flower/nfp_flower_representor.c   |  4 +--
 drivers/net/ngbe/ngbe_rxtx.c                  |  8 ++---
 drivers/net/qede/qede_ethdev.c                | 10 +++----
 drivers/net/txgbe/txgbe_ethdev_vf.c           |  6 ++--
 drivers/raw/ifpga/afu_pmd_core.c              |  3 +-
 examples/fips_validation/fips_validation.c    |  8 ++---
 examples/l3fwd-graph/main.c                   |  2 +-
 examples/pipeline/cli.c                       |  2 +-
 examples/vhost_blk/vhost_blk.c                |  5 ++--
 lib/bbdev/rte_bbdev.c                         |  2 +-
 lib/ethdev/sff_8636.c                         | 11 ++++---
 45 files changed, 157 insertions(+), 170 deletions(-)
Signature · 1 line
2.39.2