aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/epca.c3
-rw-r--r--drivers/char/ftape/lowlevel/fdc-io.c2
-rw-r--r--drivers/char/tty_io.c11
-rw-r--r--drivers/input/serio/hp_sdc_mlc.c7
-rw-r--r--drivers/isdn/hisax/hisax_fcpcipnp.c7
-rw-r--r--drivers/isdn/hisax/hisax_isac.c9
-rw-r--r--drivers/isdn/hisax/st5481_b.c4
-rw-r--r--drivers/isdn/hisax/st5481_d.c4
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c6
-rw-r--r--drivers/md/dm-path-selector.c3
-rw-r--r--drivers/md/dm-table.c6
-rw-r--r--drivers/mtd/chips/Kconfig5
-rw-r--r--drivers/mtd/maps/dilnetpc.c8
-rw-r--r--drivers/mtd/mtd_blkdevs.c3
-rw-r--r--drivers/mtd/mtdconcat.c6
-rw-r--r--drivers/s390/block/dasd_devmap.c6
-rw-r--r--fs/buffer.c9
-rw-r--r--fs/dcache.c11
-rw-r--r--fs/ext2/dir.c6
-rw-r--r--fs/hfs/bnode.c9
-rw-r--r--fs/hfs/btree.c3
-rw-r--r--init/do_mounts.c1
-rw-r--r--ipc/sem.c6
-rw-r--r--kernel/fork.c3
-rw-r--r--mm/memory.c6
-rw-r--r--mm/mempool.c4
26 files changed, 50 insertions, 98 deletions
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 765c5c108bf4..9cad8501d62c 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -486,8 +486,7 @@ static void pc_close(struct tty_struct * tty, struct file * filp)
486 } /* End channel is open more than once */ 486 } /* End channel is open more than once */
487 487
488 /* Port open only once go ahead with shutdown & reset */ 488 /* Port open only once go ahead with shutdown & reset */
489 if (ch->count < 0) 489 BUG_ON(ch->count < 0);
490 BUG();
491 490
492 /* --------------------------------------------------------------- 491 /* ---------------------------------------------------------------
493 Let the rest of the driver know the channel is being closed. 492 Let the rest of the driver know the channel is being closed.
diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
index b2e0928e8428..093fdf98b19a 100644
--- a/drivers/char/ftape/lowlevel/fdc-io.c
+++ b/drivers/char/ftape/lowlevel/fdc-io.c
@@ -607,7 +607,7 @@ void fdc_reset(void)
607 607
608 fdc_mode = fdc_idle; 608 fdc_mode = fdc_idle;
609 609
610 /* maybe the cli()/sti() pair is not necessary, BUT: 610 /* maybe the spin_lock_irq* pair is not necessary, BUT:
611 * the following line MUST be here. Otherwise fdc_interrupt_wait() 611 * the following line MUST be here. Otherwise fdc_interrupt_wait()
612 * won't wait. Note that fdc_reset() is called from 612 * won't wait. Note that fdc_reset() is called from
613 * ftape_dumb_stop() when the fdc is busy transferring data. In this 613 * ftape_dumb_stop() when the fdc is busy transferring data. In this
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 48d795bb8c4b..811dadb9ce3e 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -543,14 +543,12 @@ void tty_ldisc_put(int disc)
543 struct tty_ldisc *ld; 543 struct tty_ldisc *ld;
544 unsigned long flags; 544 unsigned long flags;
545 545
546 if (disc < N_TTY || disc >= NR_LDISCS) 546 BUG_ON(disc < N_TTY || disc >= NR_LDISCS);
547 BUG();
548 547
549 spin_lock_irqsave(&tty_ldisc_lock, flags); 548 spin_lock_irqsave(&tty_ldisc_lock, flags);
550 ld = &tty_ldiscs[disc]; 549 ld = &tty_ldiscs[disc];
551 if(ld->refcount == 0) 550 BUG_ON(ld->refcount == 0);
552 BUG(); 551 ld->refcount--;
553 ld->refcount --;
554 module_put(ld->owner); 552 module_put(ld->owner);
555 spin_unlock_irqrestore(&tty_ldisc_lock, flags); 553 spin_unlock_irqrestore(&tty_ldisc_lock, flags);
556} 554}
@@ -645,8 +643,7 @@ void tty_ldisc_deref(struct tty_ldisc *ld)
645{ 643{
646 unsigned long flags; 644 unsigned long flags;
647 645
648 if(ld == NULL) 646 BUG_ON(ld == NULL);
649 BUG();
650 647
651 spin_lock_irqsave(&tty_ldisc_lock, flags); 648 spin_lock_irqsave(&tty_ldisc_lock, flags);
652 if(ld->refcount == 0) 649 if(ld->refcount == 0)
diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c
index 1c9426fd5205..aa4a8a4ccfdb 100644
--- a/drivers/input/serio/hp_sdc_mlc.c
+++ b/drivers/input/serio/hp_sdc_mlc.c
@@ -270,9 +270,10 @@ static void hp_sdc_mlc_out (hil_mlc *mlc) {
270 270
271 do_control: 271 do_control:
272 priv->emtestmode = mlc->opacket & HIL_CTRL_TEST; 272 priv->emtestmode = mlc->opacket & HIL_CTRL_TEST;
273 if ((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE) { 273
274 BUG(); /* we cannot emulate this, it should not be used. */ 274 /* we cannot emulate this, it should not be used. */
275 } 275 BUG_ON((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE);
276
276 if ((mlc->opacket & HIL_CTRL_ONLY) == HIL_CTRL_ONLY) goto control_only; 277 if ((mlc->opacket & HIL_CTRL_ONLY) == HIL_CTRL_ONLY) goto control_only;
277 if (mlc->opacket & HIL_CTRL_APE) { 278 if (mlc->opacket & HIL_CTRL_APE) {
278 BUG(); /* Should not send command/data after engaging APE */ 279 BUG(); /* Should not send command/data after engaging APE */
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index dc7ef957e897..dbcca287ee2c 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -387,8 +387,7 @@ static void hdlc_fill_fifo(struct fritz_bcs *bcs)
387 387
388 DBG(0x40, "hdlc_fill_fifo"); 388 DBG(0x40, "hdlc_fill_fifo");
389 389
390 if (skb->len == 0) 390 BUG_ON(skb->len == 0);
391 BUG();
392 391
393 bcs->ctrl.sr.cmd &= ~HDLC_CMD_XME; 392 bcs->ctrl.sr.cmd &= ~HDLC_CMD_XME;
394 if (bcs->tx_skb->len > bcs->fifo_size) { 393 if (bcs->tx_skb->len > bcs->fifo_size) {
@@ -630,9 +629,7 @@ static void fritz_b_l2l1(struct hisax_if *ifc, int pr, void *arg)
630 629
631 switch (pr) { 630 switch (pr) {
632 case PH_DATA | REQUEST: 631 case PH_DATA | REQUEST:
633 if (bcs->tx_skb) 632 BUG_ON(bcs->tx_skb);
634 BUG();
635
636 bcs->tx_skb = skb; 633 bcs->tx_skb = skb;
637 DBG_SKB(1, skb); 634 DBG_SKB(1, skb);
638 hdlc_fill_fifo(bcs); 635 hdlc_fill_fifo(bcs);
diff --git a/drivers/isdn/hisax/hisax_isac.c b/drivers/isdn/hisax/hisax_isac.c
index f4972f6c1f5d..81eac344bb03 100644
--- a/drivers/isdn/hisax/hisax_isac.c
+++ b/drivers/isdn/hisax/hisax_isac.c
@@ -476,12 +476,10 @@ static void isac_fill_fifo(struct isac *isac)
476 unsigned char cmd; 476 unsigned char cmd;
477 u_char *ptr; 477 u_char *ptr;
478 478
479 if (!isac->tx_skb) 479 BUG_ON(!isac->tx_skb);
480 BUG();
481 480
482 count = isac->tx_skb->len; 481 count = isac->tx_skb->len;
483 if (count <= 0) 482 BUG_ON(count <= 0);
484 BUG();
485 483
486 DBG(DBG_IRQ, "count %d", count); 484 DBG(DBG_IRQ, "count %d", count);
487 485
@@ -859,8 +857,7 @@ void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg)
859 dev_kfree_skb(skb); 857 dev_kfree_skb(skb);
860 break; 858 break;
861 } 859 }
862 if (isac->tx_skb) 860 BUG_ON(isac->tx_skb);
863 BUG();
864 861
865 isac->tx_skb = skb; 862 isac->tx_skb = skb;
866 isac_fill_fifo(isac); 863 isac_fill_fifo(isac);
diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
index 657817a591fe..22fd5db18d48 100644
--- a/drivers/isdn/hisax/st5481_b.c
+++ b/drivers/isdn/hisax/st5481_b.c
@@ -356,9 +356,7 @@ void st5481_b_l2l1(struct hisax_if *ifc, int pr, void *arg)
356 356
357 switch (pr) { 357 switch (pr) {
358 case PH_DATA | REQUEST: 358 case PH_DATA | REQUEST:
359 if (bcs->b_out.tx_skb) 359 BUG_ON(bcs->b_out.tx_skb);
360 BUG();
361
362 bcs->b_out.tx_skb = skb; 360 bcs->b_out.tx_skb = skb;
363 break; 361 break;
364 case PH_ACTIVATE | REQUEST: 362 case PH_ACTIVATE | REQUEST:
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index 941f7022ada1..493dc94992e5 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -596,9 +596,7 @@ void st5481_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg)
596 break; 596 break;
597 case PH_DATA | REQUEST: 597 case PH_DATA | REQUEST:
598 DBG(2, "PH_DATA REQUEST len %d", skb->len); 598 DBG(2, "PH_DATA REQUEST len %d", skb->len);
599 if (adapter->d_out.tx_skb) 599 BUG_ON(adapter->d_out.tx_skb);
600 BUG();
601
602 adapter->d_out.tx_skb = skb; 600 adapter->d_out.tx_skb = skb;
603 FsmEvent(&adapter->d_out.fsm, EV_DOUT_START_XMIT, NULL); 601 FsmEvent(&adapter->d_out.fsm, EV_DOUT_START_XMIT, NULL);
604 break; 602 break;
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index b9fed8a3bcc6..a0927d1b7a0c 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -974,8 +974,7 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf
974 int slot; 974 int slot;
975 int proto; 975 int proto;
976 976
977 if (net_dev->local->master) 977 BUG_ON(net_dev->local->master); // we're called with the master device always
978 BUG(); // we're called with the master device always
979 978
980 slot = lp->ppp_slot; 979 slot = lp->ppp_slot;
981 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 980 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
@@ -2527,8 +2526,7 @@ static struct sk_buff *isdn_ppp_decompress(struct sk_buff *skb,struct ippp_struc
2527 printk(KERN_DEBUG "ippp: no decompressor defined!\n"); 2526 printk(KERN_DEBUG "ippp: no decompressor defined!\n");
2528 return skb; 2527 return skb;
2529 } 2528 }
2530 if (!stat) // if we have a compressor, stat has been set as well 2529 BUG_ON(!stat); // if we have a compressor, stat has been set as well
2531 BUG();
2532 2530
2533 if((master && *proto == PPP_COMP) || (!master && *proto == PPP_COMPFRAG) ) { 2531 if((master && *proto == PPP_COMP) || (!master && *proto == PPP_COMPFRAG) ) {
2534 // compressed packets are compressed by their protocol type 2532 // compressed packets are compressed by their protocol type
diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c
index a28c1c2b4ef5..f10a0c89b3f4 100644
--- a/drivers/md/dm-path-selector.c
+++ b/drivers/md/dm-path-selector.c
@@ -86,8 +86,7 @@ void dm_put_path_selector(struct path_selector_type *pst)
86 if (--psi->use == 0) 86 if (--psi->use == 0)
87 module_put(psi->pst.module); 87 module_put(psi->pst.module);
88 88
89 if (psi->use < 0) 89 BUG_ON(psi->use < 0);
90 BUG();
91 90
92out: 91out:
93 up_read(&_ps_lock); 92 up_read(&_ps_lock);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 9b1e2f5ca630..907b08ddb783 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -352,8 +352,7 @@ static int open_dev(struct dm_dev *d, dev_t dev)
352 352
353 int r; 353 int r;
354 354
355 if (d->bdev) 355 BUG_ON(d->bdev);
356 BUG();
357 356
358 bdev = open_by_devnum(dev, d->mode); 357 bdev = open_by_devnum(dev, d->mode);
359 if (IS_ERR(bdev)) 358 if (IS_ERR(bdev))
@@ -427,8 +426,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
427 struct dm_dev *dd; 426 struct dm_dev *dd;
428 unsigned int major, minor; 427 unsigned int major, minor;
429 428
430 if (!t) 429 BUG_ON(!t);
431 BUG();
432 430
433 if (sscanf(path, "%u:%u", &major, &minor) == 2) { 431 if (sscanf(path, "%u:%u", &major, &minor) == 2) {
434 /* Extract the major/minor numbers */ 432 /* Extract the major/minor numbers */
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index 205bb7083335..0f6bb2e625d8 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -25,9 +25,8 @@ config MTD_JEDECPROBE
25 compatible with the Common Flash Interface, but will use the common 25 compatible with the Common Flash Interface, but will use the common
26 CFI-targetted flash drivers for any chips which are identified which 26 CFI-targetted flash drivers for any chips which are identified which
27 are in fact compatible in all but the probe method. This actually 27 are in fact compatible in all but the probe method. This actually
28 covers most AMD/Fujitsu-compatible chips, and will shortly cover also 28 covers most AMD/Fujitsu-compatible chips and also non-CFI
29 non-CFI Intel chips (that code is in MTD CVS and should shortly be sent 29 Intel chips.
30 for inclusion in Linus' tree)
31 30
32config MTD_GEN_PROBE 31config MTD_GEN_PROBE
33 tristate 32 tristate
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c
index b51c757817d8..efb221692641 100644
--- a/drivers/mtd/maps/dilnetpc.c
+++ b/drivers/mtd/maps/dilnetpc.c
@@ -218,8 +218,8 @@ static void dnp_set_vpp(struct map_info *not_used, int on)
218 { 218 {
219 if(--vpp_counter == 0) 219 if(--vpp_counter == 0)
220 setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x4); 220 setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x4);
221 else if(vpp_counter < 0) 221 else
222 BUG(); 222 BUG_ON(vpp_counter < 0);
223 } 223 }
224 spin_unlock_irq(&dnpc_spin); 224 spin_unlock_irq(&dnpc_spin);
225} 225}
@@ -240,8 +240,8 @@ static void adnp_set_vpp(struct map_info *not_used, int on)
240 { 240 {
241 if(--vpp_counter == 0) 241 if(--vpp_counter == 0)
242 setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x8); 242 setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x8);
243 else if(vpp_counter < 0) 243 else
244 BUG(); 244 BUG_ON(vpp_counter < 0);
245 } 245 }
246 spin_unlock_irq(&dnpc_spin); 246 spin_unlock_irq(&dnpc_spin);
247} 247}
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 7f3ff500b68e..840dd66ce2dc 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -450,8 +450,7 @@ int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr)
450 450
451 kfree(tr->blkcore_priv); 451 kfree(tr->blkcore_priv);
452 452
453 if (!list_empty(&tr->devs)) 453 BUG_ON(!list_empty(&tr->devs));
454 BUG();
455 return 0; 454 return 0;
456} 455}
457 456
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index b1bf8c411de7..9af840364a74 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -477,8 +477,7 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
477 } 477 }
478 478
479 /* must never happen since size limit has been verified above */ 479 /* must never happen since size limit has been verified above */
480 if (i >= concat->num_subdev) 480 BUG_ON(i >= concat->num_subdev);
481 BUG();
482 481
483 /* now do the erase: */ 482 /* now do the erase: */
484 err = 0; 483 err = 0;
@@ -500,8 +499,7 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
500 if ((err = concat_dev_erase(subdev, erase))) { 499 if ((err = concat_dev_erase(subdev, erase))) {
501 /* sanity check: should never happen since 500 /* sanity check: should never happen since
502 * block alignment has been checked above */ 501 * block alignment has been checked above */
503 if (err == -EINVAL) 502 BUG_ON(err == -EINVAL);
504 BUG();
505 if (erase->fail_addr != 0xffffffff) 503 if (erase->fail_addr != 0xffffffff)
506 instr->fail_addr = erase->fail_addr + offset; 504 instr->fail_addr = erase->fail_addr + offset;
507 break; 505 break;
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 2f720108a7e0..c1c6f1381150 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -437,8 +437,7 @@ dasd_forget_ranges(void)
437 spin_lock(&dasd_devmap_lock); 437 spin_lock(&dasd_devmap_lock);
438 for (i = 0; i < 256; i++) { 438 for (i = 0; i < 256; i++) {
439 list_for_each_entry_safe(devmap, n, &dasd_hashlists[i], list) { 439 list_for_each_entry_safe(devmap, n, &dasd_hashlists[i], list) {
440 if (devmap->device != NULL) 440 BUG_ON(devmap->device != NULL);
441 BUG();
442 list_del(&devmap->list); 441 list_del(&devmap->list);
443 kfree(devmap); 442 kfree(devmap);
444 } 443 }
@@ -547,8 +546,7 @@ dasd_delete_device(struct dasd_device *device)
547 546
548 /* First remove device pointer from devmap. */ 547 /* First remove device pointer from devmap. */
549 devmap = dasd_find_busid(device->cdev->dev.bus_id); 548 devmap = dasd_find_busid(device->cdev->dev.bus_id);
550 if (IS_ERR(devmap)) 549 BUG_ON(IS_ERR(devmap));
551 BUG();
552 spin_lock(&dasd_devmap_lock); 550 spin_lock(&dasd_devmap_lock);
553 if (devmap->device != device) { 551 if (devmap->device != device) {
554 spin_unlock(&dasd_devmap_lock); 552 spin_unlock(&dasd_devmap_lock);
diff --git a/fs/buffer.c b/fs/buffer.c
index a507b58550f1..d597758dd129 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -798,8 +798,7 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode)
798 if (!mapping->assoc_mapping) { 798 if (!mapping->assoc_mapping) {
799 mapping->assoc_mapping = buffer_mapping; 799 mapping->assoc_mapping = buffer_mapping;
800 } else { 800 } else {
801 if (mapping->assoc_mapping != buffer_mapping) 801 BUG_ON(mapping->assoc_mapping != buffer_mapping);
802 BUG();
803 } 802 }
804 if (list_empty(&bh->b_assoc_buffers)) { 803 if (list_empty(&bh->b_assoc_buffers)) {
805 spin_lock(&buffer_mapping->private_lock); 804 spin_lock(&buffer_mapping->private_lock);
@@ -1116,8 +1115,7 @@ grow_dev_page(struct block_device *bdev, sector_t block,
1116 if (!page) 1115 if (!page)
1117 return NULL; 1116 return NULL;
1118 1117
1119 if (!PageLocked(page)) 1118 BUG_ON(!PageLocked(page));
1120 BUG();
1121 1119
1122 if (page_has_buffers(page)) { 1120 if (page_has_buffers(page)) {
1123 bh = page_buffers(page); 1121 bh = page_buffers(page);
@@ -1524,8 +1522,7 @@ void set_bh_page(struct buffer_head *bh,
1524 struct page *page, unsigned long offset) 1522 struct page *page, unsigned long offset)
1525{ 1523{
1526 bh->b_page = page; 1524 bh->b_page = page;
1527 if (offset >= PAGE_SIZE) 1525 BUG_ON(offset >= PAGE_SIZE);
1528 BUG();
1529 if (PageHighMem(page)) 1526 if (PageHighMem(page))
1530 /* 1527 /*
1531 * This catches illegal uses and preserves the offset: 1528 * This catches illegal uses and preserves the offset:
diff --git a/fs/dcache.c b/fs/dcache.c
index aaca5e7970bc..19458d399502 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -34,7 +34,6 @@
34#include <linux/swap.h> 34#include <linux/swap.h>
35#include <linux/bootmem.h> 35#include <linux/bootmem.h>
36 36
37/* #define DCACHE_DEBUG 1 */
38 37
39int sysctl_vfs_cache_pressure __read_mostly = 100; 38int sysctl_vfs_cache_pressure __read_mostly = 100;
40EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); 39EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
@@ -603,10 +602,6 @@ resume:
603 */ 602 */
604 if (!list_empty(&dentry->d_subdirs)) { 603 if (!list_empty(&dentry->d_subdirs)) {
605 this_parent = dentry; 604 this_parent = dentry;
606#ifdef DCACHE_DEBUG
607printk(KERN_DEBUG "select_parent: descending to %s/%s, found=%d\n",
608dentry->d_parent->d_name.name, dentry->d_name.name, found);
609#endif
610 goto repeat; 605 goto repeat;
611 } 606 }
612 } 607 }
@@ -616,10 +611,6 @@ dentry->d_parent->d_name.name, dentry->d_name.name, found);
616 if (this_parent != parent) { 611 if (this_parent != parent) {
617 next = this_parent->d_u.d_child.next; 612 next = this_parent->d_u.d_child.next;
618 this_parent = this_parent->d_parent; 613 this_parent = this_parent->d_parent;
619#ifdef DCACHE_DEBUG
620printk(KERN_DEBUG "select_parent: ascending to %s/%s, found=%d\n",
621this_parent->d_parent->d_name.name, this_parent->d_name.name, found);
622#endif
623 goto resume; 614 goto resume;
624 } 615 }
625out: 616out:
@@ -798,7 +789,7 @@ struct dentry *d_alloc_name(struct dentry *parent, const char *name)
798 789
799void d_instantiate(struct dentry *entry, struct inode * inode) 790void d_instantiate(struct dentry *entry, struct inode * inode)
800{ 791{
801 if (!list_empty(&entry->d_alias)) BUG(); 792 BUG_ON(!list_empty(&entry->d_alias));
802 spin_lock(&dcache_lock); 793 spin_lock(&dcache_lock);
803 if (inode) 794 if (inode)
804 list_add(&entry->d_alias, &inode->i_dentry); 795 list_add(&entry->d_alias, &inode->i_dentry);
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index b3dbd716cd3a..0165388c425c 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -416,8 +416,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
416 416
417 lock_page(page); 417 lock_page(page);
418 err = page->mapping->a_ops->prepare_write(NULL, page, from, to); 418 err = page->mapping->a_ops->prepare_write(NULL, page, from, to);
419 if (err) 419 BUG_ON(err);
420 BUG();
421 de->inode = cpu_to_le32(inode->i_ino); 420 de->inode = cpu_to_le32(inode->i_ino);
422 ext2_set_de_type (de, inode); 421 ext2_set_de_type (de, inode);
423 err = ext2_commit_chunk(page, from, to); 422 err = ext2_commit_chunk(page, from, to);
@@ -554,8 +553,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
554 from = (char*)pde - (char*)page_address(page); 553 from = (char*)pde - (char*)page_address(page);
555 lock_page(page); 554 lock_page(page);
556 err = mapping->a_ops->prepare_write(NULL, page, from, to); 555 err = mapping->a_ops->prepare_write(NULL, page, from, to);
557 if (err) 556 BUG_ON(err);
558 BUG();
559 if (pde) 557 if (pde)
560 pde->rec_len = cpu_to_le16(to-from); 558 pde->rec_len = cpu_to_le16(to-from);
561 dir->inode = 0; 559 dir->inode = 0;
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index a7a7d77f3fd3..1e44dcfe49c4 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -306,8 +306,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node)
306 for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; 306 for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)];
307 *p && *p != node; p = &(*p)->next_hash) 307 *p && *p != node; p = &(*p)->next_hash)
308 ; 308 ;
309 if (!*p) 309 BUG_ON(!*p);
310 BUG();
311 *p = node->next_hash; 310 *p = node->next_hash;
312 node->tree->node_hash_cnt--; 311 node->tree->node_hash_cnt--;
313} 312}
@@ -415,8 +414,7 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
415 spin_lock(&tree->hash_lock); 414 spin_lock(&tree->hash_lock);
416 node = hfs_bnode_findhash(tree, num); 415 node = hfs_bnode_findhash(tree, num);
417 spin_unlock(&tree->hash_lock); 416 spin_unlock(&tree->hash_lock);
418 if (node) 417 BUG_ON(node);
419 BUG();
420 node = __hfs_bnode_create(tree, num); 418 node = __hfs_bnode_create(tree, num);
421 if (!node) 419 if (!node)
422 return ERR_PTR(-ENOMEM); 420 return ERR_PTR(-ENOMEM);
@@ -459,8 +457,7 @@ void hfs_bnode_put(struct hfs_bnode *node)
459 457
460 dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", 458 dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n",
461 node->tree->cnid, node->this, atomic_read(&node->refcnt)); 459 node->tree->cnid, node->this, atomic_read(&node->refcnt));
462 if (!atomic_read(&node->refcnt)) 460 BUG_ON(!atomic_read(&node->refcnt));
463 BUG();
464 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) 461 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock))
465 return; 462 return;
466 for (i = 0; i < tree->pages_per_bnode; i++) { 463 for (i = 0; i < tree->pages_per_bnode; i++) {
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 7bb11edd1488..d20131ce4b95 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -36,8 +36,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
36 tree->inode = iget_locked(sb, id); 36 tree->inode = iget_locked(sb, id);
37 if (!tree->inode) 37 if (!tree->inode)
38 goto free_tree; 38 goto free_tree;
39 if (!(tree->inode->i_state & I_NEW)) 39 BUG_ON(!(tree->inode->i_state & I_NEW));
40 BUG();
41 { 40 {
42 struct hfs_mdb *mdb = HFS_SB(sb)->mdb; 41 struct hfs_mdb *mdb = HFS_SB(sb)->mdb;
43 HFS_I(tree->inode)->flags = 0; 42 HFS_I(tree->inode)->flags = 0;
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 8b671fe68afa..adb7cad3e6ee 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -23,7 +23,6 @@ int root_mountflags = MS_RDONLY | MS_SILENT;
23char * __initdata root_device_name; 23char * __initdata root_device_name;
24static char __initdata saved_root_name[64]; 24static char __initdata saved_root_name[64];
25 25
26/* this is initialized in init/main.c */
27dev_t ROOT_DEV; 26dev_t ROOT_DEV;
28 27
29static int __init load_ramdisk(char *str) 28static int __init load_ramdisk(char *str)
diff --git a/ipc/sem.c b/ipc/sem.c
index 48a54f66a246..642659cd596b 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -229,8 +229,7 @@ asmlinkage long sys_semget (key_t key, int nsems, int semflg)
229 err = -EEXIST; 229 err = -EEXIST;
230 } else { 230 } else {
231 sma = sem_lock(id); 231 sma = sem_lock(id);
232 if(sma==NULL) 232 BUG_ON(sma==NULL);
233 BUG();
234 if (nsems > sma->sem_nsems) 233 if (nsems > sma->sem_nsems)
235 err = -EINVAL; 234 err = -EINVAL;
236 else if (ipcperms(&sma->sem_perm, semflg)) 235 else if (ipcperms(&sma->sem_perm, semflg))
@@ -1183,8 +1182,7 @@ retry_undos:
1183 1182
1184 sma = sem_lock(semid); 1183 sma = sem_lock(semid);
1185 if(sma==NULL) { 1184 if(sma==NULL) {
1186 if(queue.prev != NULL) 1185 BUG_ON(queue.prev != NULL);
1187 BUG();
1188 error = -EIDRM; 1186 error = -EIDRM;
1189 goto out_free; 1187 goto out_free;
1190 } 1188 }
diff --git a/kernel/fork.c b/kernel/fork.c
index 4bd6486aa67d..e0a2b449dea6 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -769,8 +769,7 @@ int unshare_files(void)
769 struct files_struct *files = current->files; 769 struct files_struct *files = current->files;
770 int rc; 770 int rc;
771 771
772 if(!files) 772 BUG_ON(!files);
773 BUG();
774 773
775 /* This can race but the race causes us to copy when we don't 774 /* This can race but the race causes us to copy when we don't
776 need to and drop the copy */ 775 need to and drop the copy */
diff --git a/mm/memory.c b/mm/memory.c
index 67686048f094..8d8f52569f32 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2354,10 +2354,8 @@ int make_pages_present(unsigned long addr, unsigned long end)
2354 if (!vma) 2354 if (!vma)
2355 return -1; 2355 return -1;
2356 write = (vma->vm_flags & VM_WRITE) != 0; 2356 write = (vma->vm_flags & VM_WRITE) != 0;
2357 if (addr >= end) 2357 BUG_ON(addr >= end);
2358 BUG(); 2358 BUG_ON(end > vma->vm_end);
2359 if (end > vma->vm_end)
2360 BUG();
2361 len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE; 2359 len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
2362 ret = get_user_pages(current, current->mm, addr, 2360 ret = get_user_pages(current, current->mm, addr,
2363 len, write, 0, NULL, NULL); 2361 len, write, 0, NULL, NULL);
diff --git a/mm/mempool.c b/mm/mempool.c
index 7bf064e6a345..fe6e05289cc5 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -183,8 +183,8 @@ EXPORT_SYMBOL(mempool_resize);
183 */ 183 */
184void mempool_destroy(mempool_t *pool) 184void mempool_destroy(mempool_t *pool)
185{ 185{
186 if (pool->curr_nr != pool->min_nr) 186 /* Check for outstanding elements */
187 BUG(); /* There were outstanding elements */ 187 BUG_ON(pool->curr_nr != pool->min_nr);
188 free_pool(pool); 188 free_pool(pool);
189} 189}
190EXPORT_SYMBOL(mempool_destroy); 190EXPORT_SYMBOL(mempool_destroy);