All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jessica Yu <jeyu@kernel.org>
To: zhouchuangao <zhouchuangao@vivo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/module: Use BUG_ON instead of if condition followed by BUG.
Date: Mon, 12 Apr 2021 15:04:58 +0200	[thread overview]
Message-ID: <YHRFegmoOURrmHp3@gunter> (raw)
In-Reply-To: <1617106055-6295-1-git-send-email-zhouchuangao@vivo.com>

+++ zhouchuangao [30/03/21 05:07 -0700]:
>It can be optimized at compile time.
>
>Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>

Hi,

Could you please provide a more descriptive changelog? I.e., Is this
a fix for a cocinelle warning? What are the optimization(s)?

Thanks,

Jessica

>---
> kernel/module.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index 3047935..f46fc4f 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -1014,8 +1014,8 @@ void __symbol_put(const char *symbol)
> 	};
>
> 	preempt_disable();
>-	if (!find_symbol(&fsa))
>-		BUG();
>+	BUG_ON(!find_symbol(&fsa));
>+
> 	module_put(fsa.owner);
> 	preempt_enable();
> }
>-- 
>2.7.4
>

  reply	other threads:[~2021-04-12 13:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 12:07 [PATCH] kernel/module: Use BUG_ON instead of if condition followed by BUG zhouchuangao
2021-04-12 13:04 ` Jessica Yu [this message]
2021-04-13  7:21   ` 周传高
2021-04-13 12:42     ` Jessica Yu
  -- strict thread matches above, loose matches on Subject: below --
2021-04-17 10:22 zhouchuangao
2021-05-10  1:38 zhouchuangao
2021-05-12 12:54 ` Jessica Yu

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=YHRFegmoOURrmHp3@gunter \
    --to=jeyu@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhouchuangao@vivo.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.