* [PATCH] kernel/softirq: use BUG_ON conditional instead of BUG in softirq.
@ 2017-10-13 17:09 Tim Hansen
0 siblings, 0 replies; only message in thread
From: Tim Hansen @ 2017-10-13 17:09 UTC (permalink / raw)
To: sagi; +Cc: mingo, neilb, devtimhansen, alexander.levin, thumshirn,
linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-13 17:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 17:09 [PATCH] kernel/softirq: use BUG_ON conditional instead of BUG in softirq Tim Hansen
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.