Re: [PATCH v2] bug: fix warning suppressions with kunit built as module
From: Bartosz Golaszewski
Date: Wed Jul 08 2026 - 06:09:52 EST
On Wed, 8 Jul 2026 12:07:40 +0200, Bartosz Golaszewski <brgl@xxxxxxxxxx> said:
> On Wed, 8 Jul 2026 12:03:31 +0200, David Gow <david@xxxxxxxxxxxx> said:
>> Le 08/07/2026 à 5:54 PM, Bartosz Golaszewski a écrit :
>>> CONFIG_KUNIT is a tristate symbol but the warning suppression code in
>>> lib/bug.c is only built if it's built-in due to it using a plain #ifdef,
>>> rendering warning suppressions broken for kunit build as loadable module.
>>>
>>> kunit_is_suppressed_warning() already has a stub for when kunit is
>>> disabled so drop that guard entirely.
>>>
>>> Suggested-by: Albert Esteve <aesteve@xxxxxxxxxx>
>>> Cc: stable@xxxxxxxxxxxxxxx
>>> Fixes: 85347718ab0d ("bug/kunit: Core support for suppressing warning backtraces")
>>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
>>> ---
>>> Changes in v2:
>>> - drop the guard entirely instead of switching to IS_ENABLED()
>>>
>>
>> Thanks very much. Works well here.
>>
>> Reviewed-by: David Gow <david@xxxxxxxxxxxx>
>>
>> Happy to take this via kselftest/kunit, but if you'd prefer it go in via
>> mm-nonmm, that's fine too.
>>
>
> I sent a v2 as suggested by Albert. I don't have a strong opinion on which
> one should go upstream.
>
Ah, nevermind that comment, I thought I was responding under v1.
Bart