lkml.org 
[lkml]   [2004]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[2.6 patch][0/3] BUG -> BUG_ON conversions
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.097 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site