[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200327212358.5752-6-jbi.octave@gmail.com>
Date:   Fri, 27 Mar 2020 21:23:52 +0000
From:   Jules Irenge <jbi.octave@...il.com>
To:     julia.lawall@...6.fr
Cc:     boqun.feng@...il.com, Thomas Gleixner <tglx@...utronix.de>,
        Armijn Hemel <armijn@...ldur.nl>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Muchun Song <smuchun@...il.com>,
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 05/10] softirq: Replace BUG() after if statement with BUG_ON
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@...il.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
Powered by blists - more mailing lists
 
