net: pktgen: fix code style (WARNING: Prefer strscpy over strcpy)
authorPeter Seiderer <ps.report@gmx.net>
Tue, 15 Apr 2025 11:29:16 +0000 (13:29 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Apr 2025 11:02:41 +0000 (13:02 +0200)
commit422cf22aa332f80657eac39f6853f1340eabab10
treef8a98d6cf3cbbcb08f4083e8a1564654e9581dab
parent65f5b9cb543189906559d5486dfe2fdf97d433a5
net: pktgen: fix code style (WARNING: Prefer strscpy over strcpy)

Fix checkpatch code style warnings:

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #1423: FILE: net/core/pktgen.c:1423:
  +                       strcpy(pkt_dev->dst_min, buf);

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #1444: FILE: net/core/pktgen.c:1444:
  +                       strcpy(pkt_dev->dst_max, buf);

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #1554: FILE: net/core/pktgen.c:1554:
  +                       strcpy(pkt_dev->src_min, buf);

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #1575: FILE: net/core/pktgen.c:1575:
  +                       strcpy(pkt_dev->src_max, buf);

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #3231: FILE: net/core/pktgen.c:3231:
  +                       strcpy(pkt_dev->result, "Starting");

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #3235: FILE: net/core/pktgen.c:3235:
  +                       strcpy(pkt_dev->result, "Error starting");

  WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
  #3849: FILE: net/core/pktgen.c:3849:
  +       strcpy(pkt_dev->odevname, ifname);

While at it squash memset/strcpy pattern into single strscpy_pad call.

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250415112916.113455-4-ps.report@gmx.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/pktgen.c