mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Gow <david@davidgow.net>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Albert Esteve <aesteve@redhat.com>, Kees Cook <kees@kernel.org>,
	Alessandro Carminati <acarmina@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	Rae Moar <raemoar63@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	brgl@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] bug: fix warning suppressions with kunit built as module
Date: Wed, 8 Jul 2026 18:03:31 +0800	[thread overview]
Message-ID: <ece47e97-0287-4e83-b9fc-294407393f82@davidgow.net> (raw)
In-Reply-To: <20260708095459.12111-1-bartosz.golaszewski@oss.qualcomm.com>

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@redhat.com>
> Cc: stable@vger.kernel.org
> Fixes: 85347718ab0d ("bug/kunit: Core support for suppressing warning backtraces")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
> Changes in v2:
> - drop the guard entirely instead of switching to IS_ENABLED()
> 

Thanks very much. Works well here.

Reviewed-by: David Gow <david@davidgow.net>

Happy to take this via kselftest/kunit, but if you'd prefer it go in via
mm-nonmm, that's fine too.

Cheers,
-- David

>  lib/bug.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/bug.c b/lib/bug.c
> index 292420f45811..7c1c2c27f58e 100644
> --- a/lib/bug.c
> +++ b/lib/bug.c
> @@ -219,14 +219,12 @@ static enum bug_trap_type __report_bug(struct bug_entry *bug, unsigned long buga
>  	no_cut   = bug->flags & BUGFLAG_NO_CUT_HERE;
>  	has_args = bug->flags & BUGFLAG_ARGS;
>  
> -#ifdef CONFIG_KUNIT
>  	/*
>  	 * Before the once logic so suppressed warnings do not consume
>  	 * the single-fire budget of WARN_ON_ONCE().
>  	 */
>  	if (warning && kunit_is_suppressed_warning(true))
>  		return BUG_TRAP_TYPE_WARN;
> -#endif
>  
>  	disable_trace_on_warning();
>  


  parent reply	other threads:[~2026-07-08 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  9:54 Bartosz Golaszewski
2026-07-08 10:00 ` Albert Esteve
2026-07-08 10:03 ` David Gow [this message]
2026-07-08 10:07   ` Bartosz Golaszewski
2026-07-08 10:08     ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ece47e97-0287-4e83-b9fc-294407393f82@davidgow.net \
    --to=david@davidgow.net \
    --cc=acarmina@redhat.com \
    --cc=aesteve@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brendan.higgins@linux.dev \
    --cc=brgl@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=raemoar63@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®