All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch][0/3] BUG -> BUG_ON conversions
@ 2004-08-28 15:11 Adrian Bunk
  2004-08-28 15:15 ` [2.6 patch][1/3] ipc/ " Adrian Bunk
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Adrian Bunk @ 2004-08-28 15:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Hi Andrew,

in the following mails are the first [1] three patches that convert

  if(foo)
	BUG():

to

  BUG_ON(foo);


This makes the code slightly better readable and it might result in 
slightly better code with recent gcc versions due to the "unlikely" in 
the definition of BUG_ON (it might not be a measurable difference, but  
it comes for free).


Obviosly, in constructs like

  if (foo) {
	printk(KERN_ERR "some error");
	BUG();
  }

or

  switch (foo) {
  case A:
	...
	break;
  case B:
	...
	break;
  default:
	BUG();
  }


BUG() can't be replaced by BUG_ON(), and it's therefore unchanged.
  

cu
Adrian

[1] I plan to send more such patches.

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2004-08-29 14:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-28 15:11 [2.6 patch][0/3] BUG -> BUG_ON conversions Adrian Bunk
2004-08-28 15:15 ` [2.6 patch][1/3] ipc/ " Adrian Bunk
2004-08-28 16:05   ` Kyle Moffett
2004-08-28 16:26     ` Adrian Bunk
2004-08-28 16:50       ` Michael Buesch
2004-08-28 19:58       ` Andrew Morton
2004-08-28 20:22         ` Adrian Bunk
2004-08-28 20:59         ` Jens Axboe
2004-08-28 21:43         ` Matt Mackall
2004-08-28 15:17 ` [2.6 patch][2/3] kernel/ " Adrian Bunk
2004-08-28 16:09   ` Kyle Moffett
2004-08-28 15:18 ` [2.6 patch][3/3] mm/ " Adrian Bunk
2004-08-28 16:32   ` Denis Vlasenko
2004-08-28 20:58     ` Jens Axboe
2004-08-28 21:24       ` Adrian Bunk
2004-08-29 12:03         ` Jens Axboe
2004-08-29 12:18           ` Oliver Neukum
2004-08-29 13:01             ` Jens Axboe
2004-08-29 13:50               ` Adrian Bunk
2004-08-29 14:08                 ` Jens Axboe

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.