As requested by Simon Horman, here's the patch set to drop casts of
constants to u16 in comparisons and subtractions. Changes are applied
across all Intel wired drivers.

Per C language specification, arithmetic types with rank lower than integer
are automatically promoted to at least (signed/unsigned) int on comparisons
and subtractions. There is no point in casting to types smaller than
integer, i.e. u16, in such code paths.

Additionally:
- drop casts in "return (int)checksum;" where checksum is u16,
- *_MNG_VLAN_NONE constants equal to -1 that are cast to (u16)
  are now set to 0xFFFF.

v1 -> v2: drop casts in subtractions as well
v2 -> v3: update descs, rework *_MNG_VLAN_NONE, drop parentheses

Jacek Kowalski (5):
  e1000: drop unnecessary constant casts to u16
  e1000e: drop unnecessary constant casts to u16
  igb: drop unnecessary constant casts to u16
  igc: drop unnecessary constant casts to u16
  ixgbe: drop unnecessary casts to u16 / int

 drivers/net/ethernet/intel/e1000/e1000.h         | 2 +-
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 2 +-
 drivers/net/ethernet/intel/e1000/e1000_hw.c      | 4 ++--
 drivers/net/ethernet/intel/e1000/e1000_main.c    | 3 +--
 drivers/net/ethernet/intel/e1000e/e1000.h        | 2 +-
 drivers/net/ethernet/intel/e1000e/ethtool.c      | 2 +-
 drivers/net/ethernet/intel/e1000e/netdev.c       | 4 ++--
 drivers/net/ethernet/intel/e1000e/nvm.c          | 4 ++--
 drivers/net/ethernet/intel/igb/e1000_82575.c     | 4 ++--
 drivers/net/ethernet/intel/igb/e1000_i210.c      | 2 +-
 drivers/net/ethernet/intel/igb/e1000_nvm.c       | 4 ++--
 drivers/net/ethernet/intel/igb/igb.h             | 2 +-
 drivers/net/ethernet/intel/igb/igb_main.c        | 3 +--
 drivers/net/ethernet/intel/igc/igc_i225.c        | 2 +-
 drivers/net/ethernet/intel/igc/igc_nvm.c         | 4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c  | 4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c    | 4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c    | 4 ++--
 18 files changed, 27 insertions(+), 29 deletions(-)

-- 
2.47.2

Reply via email to