]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: Fix 64-bit division in mlxsw_sp_sb_prs_init
authorNathan Chancellor <natechancellor@gmail.com>
Wed, 30 Oct 2019 16:01:52 +0000 (09:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 20:55:34 +0000 (13:55 -0700)
commit5a3404cb43cd6cd5fa7e1b1d16030317b5a1af6a
treedefd1ea6e686d5f7f9ccce352b0713d280600628
parentf9cb431a420df71942a5c661139804b858eb3371
mlxsw: Fix 64-bit division in mlxsw_sp_sb_prs_init

When building for 32-bit ARM, there is a link time error because of a
64-bit division:

ld.lld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by spectrum_buffers.c
>>>               net/ethernet/mellanox/mlxsw/spectrum_buffers.o:(mlxsw_sp_buffers_init) in archive drivers/built-in.a
>>> did you mean: __aeabi_uidivmod
>>> defined in: arch/arm/lib/lib.a(lib1funcs.o

Avoid this by using div_u64, which is designed to avoid this problem.

Fixes: 631da68f6de2 ("mlxsw: spectrum_buffers: Calculate the size of the main pool")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c