1

ubsan: fix unused variable warning in test module

This is one of the drivers with an unused variable that is marked 'const'.
Adding a __used annotation here avoids the warning and lets us enable
the option by default:

lib/test_ubsan.c:137:28: error: unused variable 'skip_ubsan_array' [-Werror,-Wunused-const-variable]

Fixes: 4a26f49b7b ("ubsan: expand tests and reporting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240403080702.3509288-3-arnd@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
Arnd Bergmann 2024-04-03 10:06:20 +02:00 committed by Kees Cook
parent e7d24c0aa8
commit bbda3ba626

View File

@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = {
};
/* Excluded because they Oops the module. */
static const test_ubsan_fp skip_ubsan_array[] = {
static __used const test_ubsan_fp skip_ubsan_array[] = {
test_ubsan_divrem_overflow,
};