All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [Patch 5/6] BUG_ON() Conversion in kernel/signal.c
@ 2006-01-30 21:15 Eric Sesterhenn / snakebyte
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn / snakebyte @ 2006-01-30 21:15 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]

hi,  

this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.16-rc1-git4/kernel/signal.c.orig	2006-01-30 22:14:15.000000000 +0100
+++ linux-2.6.16-rc1-git4/kernel/signal.c	2006-01-30 22:14:54.000000000 +0100
@@ -355,10 +355,8 @@ void __exit_signal(struct task_struct *t
 	struct signal_struct * sig = tsk->signal;
 	struct sighand_struct * sighand;
 
-	if (!sig)
-		BUG();
-	if (!atomic_read(&sig->count))
-		BUG();
+	BUG_ON(!sig);
+	BUG_ON(!atomic_read(&sig->count));
 	rcu_read_lock();
 	sighand = rcu_dereference(tsk->sighand);
 	spin_lock(&sighand->siglock);
@@ -875,8 +873,7 @@ specific_send_sig_info(int sig, struct s
 {
 	int ret = 0;
 
-	if (!irqs_disabled())
-		BUG();
+	BUG_ON(!irqs_disabled());
 	assert_spin_locked(&t->sighand->siglock);
 
 	/* Short-circuit ignored signals.  */
@@ -1464,8 +1461,7 @@ retry:
 		 * If an SI_TIMER entry is already queue just increment
 		 * the overrun count.
 		 */
-		if (q->info.si_code != SI_TIMER)
-			BUG();
+		BUG_ON(q->info.si_code != SI_TIMER);
 		q->info.si_overrun++;
 		goto out;
 	}
@@ -1513,8 +1509,7 @@ send_group_sigqueue(int sig, struct sigq
 		 * the overrun count.  Other uses should not try to
 		 * send the signal multiple times.
 		 */
-		if (q->info.si_code != SI_TIMER)
-			BUG();
+		BUG_ON(q->info.si_code != SI_TIMER);
 		q->info.si_overrun++;
 		goto out;
 	} 



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-30 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 21:15 [KJ] [Patch 5/6] BUG_ON() Conversion in kernel/signal.c Eric Sesterhenn / snakebyte

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.