diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-01-21 23:23:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-23 00:00:37 -0500 |
commit | 33a0efa4baecd689da9474ce0e8b673eb6931c60 (patch) | |
tree | 83c0c8d02c5454e3f2b14090549a67f27836841e | |
parent | 8bbe833a65209632f96931415070bc3a490f2dc9 (diff) |
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: cb5ccfbe73b3 ("devlink: Add health buffer support")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/devlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index 059575c85dde..24f266468ca5 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c | |||
@@ -3599,7 +3599,7 @@ out: | |||
3599 | 3599 | ||
3600 | #define DEVLINK_HEALTH_BUFFER_SIZE (4096 - GENL_HDRLEN) | 3600 | #define DEVLINK_HEALTH_BUFFER_SIZE (4096 - GENL_HDRLEN) |
3601 | #define DEVLINK_HEALTH_BUFFER_DATA_SIZE (DEVLINK_HEALTH_BUFFER_SIZE / 2) | 3601 | #define DEVLINK_HEALTH_BUFFER_DATA_SIZE (DEVLINK_HEALTH_BUFFER_SIZE / 2) |
3602 | #define DEVLINK_HEALTH_SIZE_TO_BUFFERS(size) DIV_ROUND_UP(size, DEVLINK_HEALTH_BUFFER_DATA_SIZE) | 3602 | #define DEVLINK_HEALTH_SIZE_TO_BUFFERS(size) DIV_ROUND_UP_ULL(size, DEVLINK_HEALTH_BUFFER_DATA_SIZE) |
3603 | #define DEVLINK_HEALTH_BUFFER_MAX_CHUNK 1024 | 3603 | #define DEVLINK_HEALTH_BUFFER_MAX_CHUNK 1024 |
3604 | 3604 | ||
3605 | struct devlink_health_buffer { | 3605 | struct devlink_health_buffer { |