linux/drivers/net
Jakub Kicinski 4e59532541 nfp: don't depend on compiler constant propagation
Matthias reports:

  nfp_eth_set_bit_config() is marked as __always_inline to allow gcc to
  identify the 'mask' parameter as known to be constant at compile time,
  which is required to use the FIELD_GET() macro.

  The forced inlining does the trick for gcc, but for kernel builds with
  clang it results in undefined symbols:

  drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.o: In function
    `__nfp_eth_set_aneg':

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c:(.text+0x787):
    undefined reference to `__compiletime_assert_492'

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c:(.text+0x7b1):
    undefined reference to `__compiletime_assert_496'

  These __compiletime_assert_xyx() calls would have been optimized away
if
  the compiler had seen 'mask' as a constant.

Add a macro to extract the mask and shift and pass those to
nfp_eth_set_bit_config() separately.

Reported-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Tested-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-05 23:23:26 +09:00
..
appletalk Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
arcnet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
caif Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
cris License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
ethernet nfp: don't depend on compiler constant propagation 2017-11-05 23:23:26 +09:00
fddi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
hippi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
hyperv hv_netvsc: Set tx_table to equal weight after subchannels open 2017-10-29 12:09:23 +09:00
ieee802154 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
ipvlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-10-30 21:09:24 +09:00
phy phylink: make local function phylink_phy_change() static 2017-11-04 22:31:00 +09:00
plip net: plip: mark expected switch fall-throughs 2017-11-05 22:19:00 +09:00
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
slip Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
vmxnet3
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
wimax License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wireless wireless-drivers-next patches for 4.15 2017-11-04 18:07:50 +09:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-10-22 13:39:14 +01:00
dummy.c net: remove MTU limits for dummy and ifb device 2017-09-25 16:26:09 -07:00
eql.c drivers: net: eql: use setup_timer() helper. 2017-09-21 11:44:42 -07:00
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-10-22 13:39:14 +01:00
gtp.c
ifb.c net: remove MTU limits for dummy and ifb device 2017-09-25 16:26:09 -07:00
Kconfig net: Add support for networking over Thunderbolt cable 2017-10-02 11:24:42 -07:00
LICENSE.SRC
loopback.c
macsec.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-10-22 13:39:14 +01:00
macvlan.c macvlan/macvtap: Add support for L2 forwarding offloads with macvtap 2017-10-19 12:43:59 +01:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-10-30 21:09:24 +09:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c drivers/net: ntb_netdev: Convert timers to use timer_setup() 2017-11-01 12:38:45 +09:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tun/tap: sanitize TUNSETSNDBUF input 2017-11-01 20:52:36 +09:00
thunderbolt.c thunderbolt: Right shifting to zero bug in tbnet_handle_packet() 2017-10-19 13:04:32 +01:00
tun.c net: bpf: rename ndo_xdp to ndo_bpf 2017-11-05 22:26:18 +09:00
veth.c
virtio_net. virtio-net: support XDP_REDIRECT 2017-09-20 14:27:52 -07:00
virtio_net.c net: bpf: rename ndo_xdp to ndo_bpf 2017-11-05 22:26:18 +09:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
vsockmon.c
vxlan.c
xen-netfront.c xen-netfront, xen-netback: Use correct minimum MTU values 2017-10-16 16:00:44 -04:00