From: Tim Hansen <devtimhansen@gmail.com>
To: sagi@grimberg.me
Cc: mingo@kernel.org, neilb@suse.com, devtimhansen@gmail.com,
alexander.levin@one.verizon.com, thumshirn@suse.de,
linux-kernel@vger.kernel.org
Subject: [PATCH] kernel/softirq: use BUG_ON conditional instead of BUG in softirq.
Date: Fri, 13 Oct 2017 13:09:17 -0400 [thread overview]
Message-ID: <20171013170917.GA144590@debian> (raw)
Fix BUG() usage to BUG_ON(conditional) usage in softirq.
Found with make coccicheck M=kernel/ on linux-next tag next-20171012.
Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
kernel/softirq.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 4e09821..3da3f12 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -513,9 +513,8 @@ static __latent_entropy void tasklet_action(struct softirq_action *a)
if (tasklet_trylock(t)) {
if (!atomic_read(&t->count)) {
- if (!test_and_clear_bit(TASKLET_STATE_SCHED,
- &t->state))
- BUG();
+ BUG_ON(!test_and_clear_bit(TASKLET_STATE_SCHED,
+ &t->state));
t->func(t->data);
tasklet_unlock(t);
continue;
@@ -549,9 +548,8 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
if (tasklet_trylock(t)) {
if (!atomic_read(&t->count)) {
- if (!test_and_clear_bit(TASKLET_STATE_SCHED,
- &t->state))
- BUG();
+ BUG_ON(!test_and_clear_bit(TASKLET_STATE_SCHED,
+ &t->state));
t->func(t->data);
tasklet_unlock(t);
continue;
--
2.1.4
reply other threads:[~2017-10-13 17:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20171013170917.GA144590@debian \
--to=devtimhansen@gmail.com \
--cc=alexander.levin@one.verizon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=neilb@suse.com \
--cc=sagi@grimberg.me \
--cc=thumshirn@suse.de \
/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