diff options
| author | Vinod Koul <[email protected]> | 2019-06-28 19:07:21 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-06-29 08:43:45 +0000 |
| commit | 8f9fab480c7a87b10bb5440b5555f370272a5d59 (patch) | |
| tree | a7980854d30c6713bfc9ca225fb1f79fc6274327 /tools/testing/radix-tree/idr-test.c | |
| parent | mm, swap: fix THP swap out (diff) | |
| download | kernel-8f9fab480c7a87b10bb5440b5555f370272a5d59.tar.gz kernel-8f9fab480c7a87b10bb5440b5555f370272a5d59.zip | |
linux/kernel.h: fix overflow for DIV_ROUND_UP_ULL
DIV_ROUND_UP_ULL adds the two arguments and then invokes
DIV_ROUND_DOWN_ULL. But on a 32bit system the addition of two 32 bit
values can overflow. DIV_ROUND_DOWN_ULL does it correctly and stashes
the addition into a unsigned long long so cast the result to unsigned
long long here to avoid the overflow condition.
[[email protected]: DIV_ROUND_UP_ULL must be an rval]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/testing/radix-tree/idr-test.c')
0 files changed, 0 insertions, 0 deletions
