lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/10] softirq: Replace BUG() after if statement with BUG_ON
Date
Coccinelle reports a warning tasklet_action_common()

WARNING: Use BUG_ON instead of if condition followed by BUG

To fix this, BUG() is replaced by BUG_ON() with the recommended suggestion

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
kernel/softirq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 0427a86743a4..8a8f6ea0ff0a 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -517,9 +517,8 @@ static void tasklet_action_common(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.25.1
\
 
 \ /
  Last update: 2020-03-27 22:25    [W:0.071 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site