Skip to content
Commit d170eb69 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by David S. Miller
Browse files

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: bc9f6e94

 ("mlxsw: spectrum_buffers: Calculate the size of the main pool")
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72919b6b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment