Skip to content

Commit bbda3ba

Browse files
arndbkees
authored andcommitted
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: 4a26f49 ("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>
1 parent e7d24c0 commit bbda3ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/test_ubsan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = {
134134
};
135135

136136
/* Excluded because they Oops the module. */
137-
static const test_ubsan_fp skip_ubsan_array[] = {
137+
static __used const test_ubsan_fp skip_ubsan_array[] = {
138138
test_ubsan_divrem_overflow,
139139
};
140140

0 commit comments

Comments
 (0)