All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ajith P V <ajithpv.linux@gmail.com>
Cc: parthiban.veerasooran@microchip.com,
	christian.gromm@microchip.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: most: video: replace BUG_ON() in comp_exit
Date: Sun, 26 Apr 2026 20:47:35 +0200	[thread overview]
Message-ID: <2026042658-reword-cornbread-79a3@gregkh> (raw)
In-Reply-To: <20260416163334.80699-1-ajithpv.linux@gmail.com>

On Thu, Apr 16, 2026 at 04:33:34PM +0000, Ajith P V wrote:
> Replace BUG_ON() with WARN_ON() and pr_err inside comp_exit().
> 
> BUG_ON() is risky and not recommended to use in kernel.
> It should replace with proper handlers such as WARN()-family
> (see Documentation/process/deprecated.rst).
> 
> Signed-off-by: Ajith P V <ajithpv.linux@gmail.com>
> ---
>  drivers/staging/most/video/video.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> index 04351f8ccccf..78cbf367c308 100644
> --- a/drivers/staging/most/video/video.c
> +++ b/drivers/staging/most/video/video.c
> @@ -577,7 +577,8 @@ static void __exit comp_exit(void)
>  
>  	most_deregister_configfs_subsys(&comp);
>  	most_deregister_component(&comp);
> -	BUG_ON(!list_empty(&video_devices));
> +	if (WARN_ON(!list_empty(&video_devices)))
> +		pr_err("video_devices list not empty during module exit\n");
>  }
>  
>  module_init(comp_init);
> -- 
> 2.43.0
> 

This was sent before you:
	https://lore.kernel.org/r/20260412222318.65045-1-grondon@gmail.com

which fixes it properly.  Also see all the other times replacing
BUG_ON() with WARN_ON() has been rejected by me in the past, so this
wouldn't be ok either.

thanks,

greg k-h

      reply	other threads:[~2026-04-27  3:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 16:33 [PATCH] staging: most: video: replace BUG_ON() in comp_exit Ajith P V
2026-04-26 18:47 ` Greg KH [this message]

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=2026042658-reword-cornbread-79a3@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ajithpv.linux@gmail.com \
    --cc=christian.gromm@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=parthiban.veerasooran@microchip.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.