mbox series

[ethtool,v2,00/13] ethtool: clean up and fix

Message ID 20221208011122.2343363-1-jesse.brandeburg@intel.com (mailing list archive)
Headers show
Series ethtool: clean up and fix | expand

Message

Jesse Brandeburg Dec. 8, 2022, 1:11 a.m. UTC
This series is an update to the ethtool application code, and was
triggered by running some static analysis tools and doing some general
refactor on the ethtool code to make it clearer.

The tools run were:
$ scan-build make
$ cppcheck
$ make CFLAGS+='-fsanitize=address,undefined' LDFLAGS+='-lubsan -lasan'

The big change in this series is a refactor of all the various bit
shifts from (1 << foo) to BIT(foo).  The goal was to make the code more
readable and maintainable, while fixing a few small bugs and hopefully
preventing more in the future from people forgetting to add 1UL to a 1
being used in a bitshift.

It includes a uapi sync/update to match a patch that was sent to the kernel
separately in the following link:
Link: https://lore.kernel.org/netdev/20221207231728.2331166-1-jesse.brandeburg@intel.com/

v2: first external version, updated commit message for 7/13
v1: internal version

Jesse Brandeburg (13):
  ethtool: convert boilerplate licenses to SPDX
  ethtool: fix trivial issue in allocation
  ethtool: disallow passing null to find_option
  ethtool: commonize power related strings
  ethtool: fix extra warnings
  ethtool: fix uninitialized local variable use
  ethtool: avoid null pointer dereference
  ethtool: fix runtime errors found by sanitizers
  ethtool: merge uapi changes to implement BIT and friends
  ethtool: refactor bit shifts to use BIT and BIT_ULL
  ethtool: fix missing free of memory after failure
  ethtool: fix leak of memory after realloc
  ethtool: fix bug and use standard string parsing

 amd8111e.c                   | 198 ++++++++---------
 cmis.c                       |  10 +-
 de2104x.c                    | 410 +++++++++++++++++------------------
 ethtool.c                    |  38 ++--
 fsl_enetc.c                  |   2 -
 internal.h                   |  26 +--
 json_print.c                 |   6 +-
 json_print.h                 |   6 +-
 natsemi.c                    | 358 +++++++++++++++---------------
 netlink/bitset.c             |   6 +-
 netlink/features.c           |   4 +-
 netlink/monitor.c            |   4 +-
 netlink/msgbuff.c            |  39 ++--
 netlink/parser.c             |  13 +-
 netlink/permaddr.c           |   2 +-
 netlink/settings.c           |  10 +-
 netlink/stats.c              |   2 +-
 qsfp.c                       |  21 +-
 qsfp.h                       | 353 +++++++++++++++---------------
 realtek.c                    |  48 ++--
 rxclass.c                    |   4 +-
 sfc.c                        |   7 +-
 sff-common.c                 |   6 +-
 sff-common.h                 |   9 +-
 sfpdiag.c                    |  67 +++---
 sfpid.c                      | 151 +++++++------
 stmmac.c                     |   5 +-
 test-cmdline.c               |   5 +-
 test-common.c                |  14 +-
 test-features.c              |   5 +-
 tse.c                        |   7 +-
 uapi/linux/ethtool.h         | 112 ++++++----
 uapi/linux/ethtool_netlink.h |   6 +-
 33 files changed, 961 insertions(+), 993 deletions(-)


base-commit: 3acf7eee7ade666289f98311befe334bb57d3765