From 0ff148182c6627419afc9811ea6bb3d2a4e44fe8 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 14 Dec 2019 00:16:42 +0000 Subject: [PATCH] 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 Signed-off-by: Brian Behlendorf Closes #9732 --- module/spl/spl-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index c90ea81f29ee..92f059a90549 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -273,7 +273,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. }