From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: jk@ozlabs.org
Cc: arnd@arndb.de, mpe@ellerman.id.au, benh@kernel.crashing.org,
paulus@samba.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH] sched: replace if (cond) BUG() with BUG_ON()
Date: Wed, 17 Mar 2021 14:45:10 +0800 [thread overview]
Message-ID: <1615963510-89830-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)
Fix the following coccicheck warnings:
./arch/powerpc/platforms/cell/spufs/sched.c:908:2-5: WARNING: Use BUG_ON
instead of if condition followed by BUG.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
arch/powerpc/platforms/cell/spufs/sched.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 3692064..139a6ec 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -904,8 +904,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
struct spu_context *new = NULL;
struct spu *spu = NULL;
- if (spu_acquire(ctx))
- BUG(); /* a kernel thread never has signals pending */
+ BUG_ON(spu_acquire(ctx)); /* a kernel thread never has signals pending */
if (ctx->state != SPU_STATE_RUNNABLE)
goto out;
--
1.8.3.1
next reply other threads:[~2021-03-17 6:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 6:45 Jiapeng Chong [this message]
2021-03-17 7:00 ` [PATCH] sched: replace if (cond) BUG() with BUG_ON() Christophe Leroy
-- strict thread matches above, loose matches on Subject: below --
2021-03-17 2:45 Jiapeng Chong
2021-03-17 8:39 ` Ingo Molnar
2021-03-17 8:41 ` Ingo Molnar
2021-03-17 12:55 ` Arnd Bergmann
2021-03-17 20:05 ` Ingo Molnar
2021-03-17 21:38 ` Arnd Bergmann
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=1615963510-89830-1-git-send-email-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=jk@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).