From: Jason Wang <wangborong@cdjrlc.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, Jason Wang <wangborong@cdjrlc.com> Subject: [PATCH v2] sched: Use BUG_ON Date: Thu, 1 Jul 2021 22:11:30 +0800 [thread overview] Message-ID: <20210701141130.940-1-wangborong@cdjrlc.com> (raw) The BUG_ON macro simplifies the if condition followed by BUG, so that we can use BUG_ON instead of if condition followed by BUG. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> --- arch/powerpc/platforms/cell/spufs/sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 369206489895..0f218d9e5733 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -904,8 +904,8 @@ 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 */ + /* a kernel thread never has signals pending */ + BUG_ON(spu_acquire(ctx)); if (ctx->state != SPU_STATE_RUNNABLE) goto out; -- 2.32.0
WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <wangborong@cdjrlc.com> To: jk@ozlabs.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, Jason Wang <wangborong@cdjrlc.com>, paulus@samba.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2] sched: Use BUG_ON Date: Thu, 1 Jul 2021 22:11:30 +0800 [thread overview] Message-ID: <20210701141130.940-1-wangborong@cdjrlc.com> (raw) The BUG_ON macro simplifies the if condition followed by BUG, so that we can use BUG_ON instead of if condition followed by BUG. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> --- arch/powerpc/platforms/cell/spufs/sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 369206489895..0f218d9e5733 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -904,8 +904,8 @@ 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 */ + /* a kernel thread never has signals pending */ + BUG_ON(spu_acquire(ctx)); if (ctx->state != SPU_STATE_RUNNABLE) goto out; -- 2.32.0
next reply other threads:[~2021-07-01 14:12 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-01 14:11 Jason Wang [this message] 2021-07-01 14:11 ` [PATCH v2] sched: Use BUG_ON Jason Wang 2021-07-02 1:19 ` Jeremy Kerr 2021-07-02 1:19 ` Jeremy Kerr
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=20210701141130.940-1-wangborong@cdjrlc.com \ --to=wangborong@cdjrlc.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: linkBe 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.