linux/drivers/net/ethernet/stmicro/stmmac
Arnd Bergmann 8f704ef666 stmmac: fix signed 64-bit division
I link error on 32-bit ARM points to yet another arithmetic bug:

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o: In function `tc_setup_cbs':
stmmac_tc.c:(.text+0x148): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x1fc): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x308): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x320): undefined reference to `__aeabi_uldivmod'
stmmac_tc.c:(.text+0x33c): undefined reference to `__aeabi_uldivmod'
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o:stmmac_tc.c:(.text+0x3a4): more undefined references to `__aeabi_uldivmod' follow

I observe that the last change to add the 'ul' prefix was incorrect,
as it did not turn the result of the multiplication into a 64-bit
expression on 32-bit architectures. Further, it seems that the
do_div() macro gets confused by the fact that we pass a signed
variable rather than unsigned into it.

This changes the code to instead use the div_s64() helper that is
meant for signed division, along with changing the constant suffix
to 'll' to actually make it a 64-bit argument everywhere, fixing
both of the issues I pointed out.

I'm not completely convinced that this makes the code correct, but
I'm fairly sure that we have two problems less than before.

Fixes: 1f705bc61a ("net: stmmac: Add support for CBS QDISC")
Fixes: c18a9c0966 ("net: stmmac_tc: use 64-bit arithmetic instead of 32-bit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-07 21:16:53 +09:00
..
altr_tse_pcs.c net: ethernet: stmmac: Convert timers to use timer_setup() 2017-10-18 12:39:37 +01:00
altr_tse_pcs.h
chain_mode.c net: stmmac: Switch stmmac_mode_ops to generic HW Interface Helpers 2018-04-16 18:50:03 -04:00
common.h net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
descs_com.h
descs.h
dwmac4_core.c net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac4_descs.c net: stmmac: Let descriptor code get skbuff address 2018-05-18 11:00:16 -04:00
dwmac4_descs.h
dwmac4_dma.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-03 10:29:26 +09:00
dwmac4_dma.h net: stmmac: Set DMA buffer size in HW 2018-06-28 22:24:25 +09:00
dwmac4_lib.c
dwmac4.h net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac5.c net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac5.h net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac100_core.c net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac100_dma.c net: stmmac: Uniformize the use of dma_init_* callbacks 2018-05-18 11:00:15 -04:00
dwmac100.h
dwmac1000_core.c net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac1000_dma.c net: stmmac: Uniformize the use of dma_init_* callbacks 2018-05-18 11:00:15 -04:00
dwmac1000.h net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac_dma.h net: stmmac: Adjust dump offset of DMA registers for ethtool 2017-07-24 16:19:10 -07:00
dwmac_lib.c net: stmmac: dwmac_lib: fix interchanged sleep/timeout values in DMA reset function 2017-10-13 10:19:52 -07:00
dwmac-anarion.c net: stmmac: Add Adaptrum Anarion GMAC glue layer 2017-08-06 21:31:32 -07:00
dwmac-dwc-qos-eth.c net: stmmac: dwc-qos-eth: Fix typo in DT bindings parsing 2017-10-27 23:23:19 +09:00
dwmac-generic.c
dwmac-ipq806x.c net: ethernet: stmmac: Clean up dead code 2017-10-08 21:19:07 -07:00
dwmac-lpc18xx.c
dwmac-meson8b.c net: stmmac: dwmac-meson8b: Fix an error handling path in 'meson8b_dwmac_probe()' 2018-06-12 15:36:14 -07:00
dwmac-meson.c
dwmac-oxnas.c
dwmac-rk.c net: ethernet: stmmac: dwmac-rk: Add GMAC support for px30 2018-06-29 22:19:05 +09:00
dwmac-socfpga.c net: stmmac: socfpga: add additional ocp reset line for Stratix10 2018-06-20 14:34:26 +09:00
dwmac-sti.c
dwmac-stm32.c net: ethernet: stmmac: add adaptation for stm32mp157c. 2018-05-28 23:08:29 -04:00
dwmac-sun8i.c net: stmmac: Uniformize the use of dma_init_* callbacks 2018-05-18 11:00:15 -04:00
dwmac-sunxi.c
enh_desc.c net: stmmac: Let descriptor code get skbuff address 2018-05-18 11:00:16 -04:00
hwif.c net: stmmac: Run HWIF Quirks after getting HW caps 2018-06-15 09:38:52 -07:00
hwif.h Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-03 10:29:26 +09:00
Kconfig net: stmmac: socfpga: add additional ocp reset line for Stratix10 2018-06-20 14:34:26 +09:00
Makefile net: stmmac: Add support for U32 TC filter using Flexible RX Parser 2018-05-10 14:16:36 -04:00
mmc_core.c
mmc.h
norm_desc.c net: stmmac: Let descriptor code get skbuff address 2018-05-18 11:00:16 -04:00
ring_mode.c net: stmmac: Switch stmmac_mode_ops to generic HW Interface Helpers 2018-04-16 18:50:03 -04:00
stmmac_ethtool.c net: stmmac: Use mutex instead of spinlock 2018-05-28 22:54:15 -04:00
stmmac_hwtstamp.c net: stmmac: Switch stmmac_hwtimestamp to generic HW Interface Helpers 2018-04-16 18:49:55 -04:00
stmmac_main.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-03 10:29:26 +09:00
stmmac_mdio.c drivers: net: Remove device_node checks with of_mdiobus_register() 2018-05-16 14:20:36 -04:00
stmmac_pci.c stmmac: pci: Use dmi_system_id table for retrieving PHY addresses 2017-06-22 13:39:57 -04:00
stmmac_pcs.h
stmmac_platform.c net: stmmac: add dwmac-4.20a compatible 2018-05-28 23:08:29 -04:00
stmmac_platform.h
stmmac_ptp.c net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
stmmac_ptp.h stmmac: fix ptp header for GMAC3 hw timestamp 2017-06-09 12:39:25 -04:00
stmmac_tc.c stmmac: fix signed 64-bit division 2018-07-07 21:16:53 +09:00
stmmac.h net: stmmac: Run HWIF Quirks after getting HW caps 2018-06-15 09:38:52 -07:00