linux/drivers/net/ethernet/ti
Paul Burton 2f5281ba2a net: ti: cpmac: Fix compiler warning due to type confusion
cpmac_start_xmit() used the max() macro on skb->len (an unsigned int)
and ETH_ZLEN (a signed int literal). This led to the following compiler
warning:

  In file included from include/linux/list.h:8:0,
                   from include/linux/module.h:9,
                   from drivers/net/ethernet/ti/cpmac.c:19:
  drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_start_xmit':
  include/linux/kernel.h:748:17: warning: comparison of distinct pointer
  types lacks a cast
    (void) (&_max1 == &_max2);  \
                   ^
  drivers/net/ethernet/ti/cpmac.c:560:8: note: in expansion of macro 'max'
    len = max(skb->len, ETH_ZLEN);
          ^

On top of this, it assigned the result of the max() macro to a signed
integer whilst all further uses of it result in it being cast to varying
widths of unsigned integer.

Fix this up by using max_t to ensure the comparison is performed as
unsigned integers, and for consistency change the type of the len
variable to unsigned int.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-04 11:47:20 -07:00
..
cpmac.c net: ti: cpmac: Fix compiler warning due to type confusion 2016-09-04 11:47:20 -07:00
cpsw_ale.c
cpsw_ale.h
cpsw-common.c net: cpsw: Fix ethernet regression for dm814x 2015-11-20 10:46:33 -05:00
cpsw-phy-sel.c drivers: net: cpsw-phy-sel: add dev_warn() for unsupported PHY mode 2016-02-17 10:50:15 -05:00
cpsw.c net: ethernet: ti: cpsw: fix error return code in cpsw_set_channels() 2016-08-26 21:49:41 -07:00
cpsw.h net: ethernet: ti: cpsw: remove rx_descs property 2016-06-17 21:27:57 -07:00
cpts.c
cpts.h
davinci_cpdma.c net: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals 2016-08-23 00:13:11 -07:00
davinci_cpdma.h net: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals 2016-08-23 00:13:11 -07:00
davinci_emac.c net: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals 2016-08-23 00:13:11 -07:00
davinci_mdio.c drivers: net: davinci_mdio: enable pm runtime auto for ti cpsw-mdio 2016-06-28 08:57:19 -04:00
Kconfig net: cpsw: make TI_CPSW_PHY_SEL invisible 2016-07-16 21:27:43 -07:00
Makefile
netcp_core.c treewide: replace dev->trans_start update with helper 2016-05-04 14:16:49 -04:00
netcp_ethss.c phy: add phydev_name() wrapper 2016-01-07 14:31:25 -05:00
netcp_sgmii.c
netcp_xgbepcsr.c
netcp.h netcp: add more __le32 annotations 2015-12-11 19:34:39 -05:00
tlan.c net: tlan: don't set unused function argument 2016-06-16 17:33:12 -07:00
tlan.h