Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cae5c82022cd710ff1eedd39ca8c56b081177b18
Commit:     cae5c82022cd710ff1eedd39ca8c56b081177b18
Parent:     96e5ad309c423bc0793e746337d5632ee5a49769
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 1 23:09:36 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 23:09:36 2008 +0100

    ide: prepare init_irq() for using ide_remove_port_from_hwgroup()
    
    * BUG_ON() early if 'hwif->next == hwif' and there is a 'match' hwgroup.
    
    * Remove printk() for impossible condition and add a BUG_ON(hwgroup->drive)
      to match code in ide_unregister().
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 84810aa..88c77d6 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -996,6 +996,7 @@ static int init_irq (ide_hwif_t *hwif)
                spin_lock_irq(&ide_lock);
                hwif->next = hwgroup->hwif->next;
                hwgroup->hwif->next = hwif;
+               BUG_ON(hwif->next == hwif);
                spin_unlock_irq(&ide_lock);
        } else {
                hwgroup = kmalloc_node(sizeof(*hwgroup), GFP_KERNEL|__GFP_ZERO,
@@ -1075,7 +1076,6 @@ static int init_irq (ide_hwif_t *hwif)
 out_unlink:
        spin_lock_irq(&ide_lock);
        if (hwif->next == hwif) {
-               BUG_ON(match);
                BUG_ON(hwgroup->hwif != hwif);
                kfree(hwgroup);
        } else {
@@ -1085,8 +1085,7 @@ out_unlink:
                        g = g->next;
                g->next = hwif->next;
                if (hwgroup->hwif == hwif) {
-                       /* Impossible. */
-                       printk(KERN_ERR "Duh. Uninitialized hwif listed as 
active hwif.\n");
+                       BUG_ON(hwgroup->drive);
                        hwgroup->hwif = g;
                }
                BUG_ON(hwgroup->hwif == hwif);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to