Skip to content

compiler warnings cleanup, part 2

Michal Kubecek netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesIn review
  2. v17 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- use unsigned int for feature_flags[] (suggested by Andrew Lunn, patch 1)
- use unsigned int for argc counters and split this change out (suggested by Andrew Lunn, patches 4 and 5)
- add missing argc underflow check in do_perqueue() (patch 3)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9netlink: get rid of signed/unsigned comparison warningsnetlink/features.c netlink/netlink.c netlink/netlink.h +3 more+11 -111 reply
2/9ioctl: check presence of eeprom length argument properlyethtool.c+15 -90 replies
3/9ioctl: prevent argc underflow in do_perqueue()ethtool.c+2 -00 replies
4/9ioctl: make argc counters unsignedethtool.c internal.h+13 -131 reply
5/9ioctl: get rid of signed/unsigned comparison warningsethtool.c+17 -140 replies
6/9get rid of signed/unsigned comparison warnings in register dump parsersdsa.c fec.c ibm_emac.c +5 more+13 -110 replies
7/9settings: simplify link_mode_info[] initializersnetlink/settings.c+86 -1500 replies
8/9ioctl: convert cmdline_info arrays to named initializersethtool.c+296 -820 replies
9/9build: add -Wextra to default CFLAGSMakefile.am+1 -10 replies

Reviews trailers per patch

7 of 9 patches have a Reviewed-by or Acked-by.

PatchAndrew Lunn
1/9R-b
2/9R-b
3/9
4/9R-b
5/9
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH ethtool v2 0/9] compiler warnings cleanup, part 2

Two compiler warnings still appear when compiling current source:
comparison between signed and unsigned values and missing struct member initializations.

The former are mostly handled by declaring variables (loop iterators, mostly) as unsigned, only few required an explicit cast. The latter are handled by using named field initializers; in link_mode_info[] array, helper macros are also used to make code easier to read and check.

As the final step, add "-Wextra" to default CFLAGS to catch any future warnings as early as possible.

changes between v1 and v2:
- use unsigned int for feature_flags[] (suggested by Andrew Lunn, patch 1)
- use unsigned int for argc counters and split this change out (suggested by Andrew Lunn, patches 4 and 5)
- add missing argc underflow check in do_perqueue() (patch 3)

Michal Kubecek (9):
netlink: get rid of signed/unsigned comparison warnings
ioctl: check presence of eeprom length argument properly
ioctl: prevent argc underflow in do_perqueue()
ioctl: make argc counters unsigned
ioctl: get rid of signed/unsigned comparison warnings get rid of signed/unsigned comparison warnings in register dump
parsers
settings: simplify link_mode_info[] initializers
ioctl: convert cmdline_info arrays to named initializers
build: add -Wextra to default CFLAGS

 Makefile.am        |   2 +-
 dsa.c              |   2 +-
 ethtool.c          | 447 ++++++++++++++++++++++++++++++++++-----------
 fec.c              |   2 +-
 ibm_emac.c         |   2 +-
 internal.h         |   2 +-
 marvell.c          |   2 +-
 natsemi.c          |   2 +-
 netlink/features.c |   6 +-
 netlink/netlink.c  |   4 +-
 netlink/netlink.h  |   2 +-
 netlink/nlsock.c   |   2 +-
 netlink/parser.c   |   2 +-
 netlink/settings.c | 242 +++++++++---------------
 rxclass.c          |   8 +-
 sfpdiag.c          |   2 +-
 tg3.c              |   4 +-
 17 files changed, 448 insertions(+), 285 deletions(-)
Signature · 1 line
2.28.0