[PATCH] kernel/softirq: use BUG_ON conditional instead of BUG in softirq.

From: Tim Hansen
Date: Fri Oct 13 2017 - 13:08:25 EST


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@xxxxxxxxx>
---
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