summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorUbuntu <[email protected]>2019-12-14 00:16:42 +0000
committerBrian Behlendorf <[email protected]>2019-12-18 17:24:42 -0800
commitabfdb836079410d73ce0ee25fb4e8aec7e7c59ae (patch)
tree760e8819e06df6d06d3f5021de0d389a94504648 /module
parent7cf1fe63316d20ae7986b4060337d0e2966a42b1 (diff)
cppcheck: (error) Shifting signed 64-bit value by 63 bits
As of cppcheck 1.82 surpress the warning regarding shifting too many bits for __divdi3() implemention. The algorithm used here is correct. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9732
Diffstat (limited to 'module')
-rw-r--r--module/os/linux/spl/spl-generic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c
index 8a14acd11..091a52a78 100644
--- a/module/os/linux/spl/spl-generic.c
+++ b/module/os/linux/spl/spl-generic.c
@@ -275,7 +275,9 @@ int64_t
__divdi3(int64_t u, int64_t v)
{
int64_t q, t;
+ // cppcheck-suppress shiftTooManyBitsSigned
q = __udivdi3(abs64(u), abs64(v));
+ // cppcheck-suppress shiftTooManyBitsSigned
t = (u ^ v) >> 63; // If u, v have different
return ((q ^ t) - t); // signs, negate q.
}