linux/drivers/net
Arnd Bergmann 49e4a22930 stmmac: avoid ipq806x constant overflow warning
Building dwmac-ipq806x on a 64-bit architecture produces a harmless
warning from gcc:

stmmac/dwmac-ipq806x.c: In function 'ipq806x_gmac_probe':
include/linux/bitops.h:6:19: warning: overflow in implicit constant conversion [-Woverflow]
  val = QSGMII_PHY_CDR_EN |
stmmac/dwmac-ipq806x.c:333:8: note: in expansion of macro 'QSGMII_PHY_CDR_EN'
 #define QSGMII_PHY_CDR_EN   BIT(0)
 #define BIT(nr)   (1UL << (nr))

This is a result of the type conversion rules in C, when we take the
logical OR of multiple different types. In particular, we have
and unsigned long

	QSGMII_PHY_CDR_EN == BIT(0) == (1ul << 0) == 0x0000000000000001ul

and a signed int

	0xC << QSGMII_PHY_TX_DRV_AMP_OFFSET == 0xc0000000

which together gives a signed long value

	0xffffffffc0000001l

and when this is passed into a function that takes an unsigned int type,
gcc warns about the signed overflow and the loss of the upper 32-bits that
are all ones.

This patch adds 'ul' type modifiers to the literal numbers passed in
here, so now the expression remains an 'unsigned long' with the upper
bits all zero, and that avoids the signed overflow and the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b1c17215d7 ("stmmac: add ipq806x glue layer")
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-12 16:11:49 -05:00
..
appletalk
arcnet arcnet/com20020: add LEDS_CLASS dependency 2015-11-03 11:29:56 -05:00
bonding bonding: fix panic on non-ARPHRD_ETHER enslave failure 2015-11-07 13:17:32 -05:00
caif net: caif: check return value of alloc_netdev 2015-11-09 11:31:13 -05:00
can spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
cris
dsa net: dsa: mv88e6xxx: isolate unbridged ports 2015-11-05 13:37:23 -05:00
ethernet stmmac: avoid ipq806x constant overflow warning 2015-11-12 16:11:49 -05:00
fddi
fjes fjes: Delete an unnecessary check before the function call "vfree" 2015-11-07 13:17:31 -05:00
hamradio
hippi
hyperv
ieee802154 spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
ipvlan ipvlan: read direct ifindex instead of iflink 2015-10-22 06:39:08 -07:00
irda
phy spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-03 13:41:45 -05:00
slip ppp, slip: Validate VJ compression slot parameters completely 2015-11-02 16:25:00 -05:00
team
usb Merge branch 'akpm' (patches from Andrew) 2015-11-10 21:14:23 -08:00
vmxnet3 drivers/net: get rid of unnecessary initializations in .get_drvinfo() 2015-10-16 00:24:10 -07:00
wan
wimax
wireless remove abs64() 2015-11-09 15:11:24 -08:00
xen-netback xen: features for 4.4-rc0 2015-11-04 17:32:42 -08:00
dummy.c net: dummy: add more features 2015-10-21 19:36:10 -07:00
eql.c
geneve.c geneve: add IPv6 bits to geneve_fill_metadata_dst 2015-10-30 12:10:54 +09:00
ifb.c
Kconfig net: Add IPv6 support to VRF device 2015-10-13 04:55:07 -07:00
LICENSE.SRC
loopback.c
macvlan.c ipv4: Pass struct net into ip_defrag and ip_check_defrag 2015-10-12 19:44:16 -07:00
macvtap.c macvtap: Resolve possible __might_sleep warning in macvtap_do_read() 2015-11-09 12:04:44 -05:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c tun: use sk_fullsock() before reading sk->sk_tsflags 2015-10-12 19:45:48 -07:00
veth.c
virtio_net.c
vrf.c net: Add IPv6 support to VRF device 2015-10-13 04:55:07 -07:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-24 06:54:12 -07:00
xen-netfront.c xen: features for 4.4-rc0 2015-11-04 17:32:42 -08:00