Skip to contentSkip to conversation

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

PATCH New Tim Hansen 1 participant 1 message Oct 13, 2017

lore
Share & tools
lore

Tim Hansen

author
#0 lore raw

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

Fix BUG() usage to BUG_ON(conditional) usage in softirq.

Found with make coccicheck M=kernel/ on linux-next tag next-20171012.

---
 kernel/softirq.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
kernel/softirq.c +4 -6
index 4e09821..3da3f12 100644
@@ -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;
Signature · 1 line
2.1.4