Skip to content

BUG -> BUG_ON conversions

Adrian Bunk lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ipc/ BUG -> BUG_ON conversionsipc/msg.c ipc/sem.c ipc/shm.c +1 more+9 -187 replies
2/3kernel/ BUG -> BUG_ON conversionskernel/cpu.c kernel/exit.c kernel/fork.c +7 more+29 -551 reply
3/3mm/ BUG -> BUG_ON conversionsmm/bootmem.c mm/filemap.c mm/highmem.c +14 more+50 -968 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [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.

Signature · 4 lines
       "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