diff options
author | Arnd Bergmann <arnd@arndb.de> | 2024-03-28 15:30:42 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-26 06:07:04 +0200 |
commit | 56fd61628b7a5c1ff474619580796f11d5c8973a (patch) | |
tree | cc141225da764b8e35afbb6554ff152c5b3dc555 /ipc/ipc_sysctl.c | |
parent | Documentation: kdump: clean up the outdated description (diff) | |
download | linux-56fd61628b7a5c1ff474619580796f11d5c8973a.tar.xz linux-56fd61628b7a5c1ff474619580796f11d5c8973a.zip |
kcov: avoid clang out-of-range warning
The area_size is never larger than the maximum on 64-bit architectutes:
kernel/kcov.c:634:29: error: result of comparison of constant 1152921504606846975 with expression of type '__u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (remote_arg->area_size > LONG_MAX / sizeof(unsigned long))
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The compiler can correctly optimize the check away and the code appears
correct to me, so just add a cast to avoid the warning.
Link: https://lkml.kernel.org/r/20240328143051.1069575-5-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'ipc/ipc_sysctl.c')
0 files changed, 0 insertions, 0 deletions