Message ID | 20240403080702.3509288-3-arnd@kernel.org (mailing list archive) |
---|---|
State | Mainlined |
Commit | bbda3ba626b9f57ff6063058877eca856f5b734d |
Headers | show |
Series | address all -Wunused-const warnings | expand |
On Wed, 03 Apr 2024 10:06:20 +0200, Arnd Bergmann wrote: > 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] > > > [...] Applied to for-next/hardening, thanks! [02/34] ubsan: fix unused variable warning in test module https://git.kernel.org/kees/c/bbda3ba626b9 Take care,
diff --git a/lib/test_ubsan.c b/lib/test_ubsan.c index 276c12140ee2..c288df9372ed 100644 --- a/lib/test_ubsan.c +++ b/lib/test_ubsan.c @@ -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, };