From d4fb6f160693017055bf6d2a8ce481e13fa2313f 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 algoritm used here is correct. Signed-off-by: Brian Behlendorf --- module/os/linux/spl/spl-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c index 8a14acd1176c..091a52a78b3e 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. }