]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Use DIV_ROUND_UP_ULL in DEVLINK_HEALTH_SIZE_TO_BUFFERS
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 22 Jan 2019 04:23:01 +0000 (21:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 05:00:37 +0000 (21:00 -0800)
commit7c8f80147d2ecf8ad9e6cbce9fcf67b35ee09c47
tree83c0c8d02c5454e3f2b14090549a67f27836841e
parent1d471b4f5f9d5422caad1b1b4a1a4bc35299ef58
devlink: Use DIV_ROUND_UP_ULL in DEVLINK_HEALTH_SIZE_TO_BUFFERS

When building this code on a 32-bit platform such as ARM, there is a
link time error (lld error shown, happpens with ld.bfd too):

ld.lld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by devlink.c
>>>               net/core/devlink.o:(devlink_health_buffers_create) in archive built-in.a

This happens when using a regular division symbol with a u64 dividend.
Use DIV_ROUND_UP_ULL, which wraps do_div, to avoid this situation.

Fixes: b8d6b760c291 ("devlink: Add health buffer support")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c