The patch below does BUG -> BUG_ON conversions in ipc/ .
--- linux-2.6.9-rc1-mm1-full-3.4/ipc/shm.c.old 2004-08-28 15:55:28.000000000 +0200
+++ linux-2.6.9-rc1-mm1-full-3.4/ipc/shm.c 2004-08-28 16:02:56.000000000 +0200
@@ -86,8 +86,7 @@
static inline void shm_inc (int id) {
struct shmid_kernel *shp;
- if(!(shp = shm_lock(id)))
- BUG();
+ BUG_ON(!(shp = shm_lock(id)));
shp->shm_atim = get_seconds();
shp->shm_lprid = current->tgid;
shp->shm_nattch++;
@@ -137,8 +136,7 @@
down (&shm_ids.sem);
/* remove from the list of attaches of the shm segment */
- if(!(shp = shm_lock(id)))
- BUG();
+ BUG_ON(!(shp = shm_lock(id)));
shp->shm_lprid = current->tgid;
shp->shm_dtim = get_seconds();
shp->shm_nattch--;
@@ -744,8 +741,7 @@
up_write(¤t->mm->mmap_sem);
down (&shm_ids.sem);
- if(!(shp = shm_lock(shmid)))
- BUG();
+ BUG_ON(!(shp = shm_lock(shmid)));
shp->shm_nattch--;
if(shp->shm_nattch == 0 &&
shp->shm_flags & SHM_DEST)