From: Andrew Morton Cc: Alex Davis Signed-off-by: Andrew Morton --- drivers/scsi/aha152x.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff -puN drivers/scsi/aha152x.c~fix-panic-when-reinserting-adaptec-pcmcia-scsi-card-tidy drivers/scsi/aha152x.c --- a/drivers/scsi/aha152x.c~fix-panic-when-reinserting-adaptec-pcmcia-scsi-card-tidy +++ a/drivers/scsi/aha152x.c @@ -771,7 +771,8 @@ static irqreturn_t swintr(int irqno, voi struct Scsi_Host *shpnt = lookup_irq(irqno); if (!shpnt) { - printk(KERN_ERR "aha152x: caught software interrupt %d for unknown controller.\n", irqno); + printk(KERN_ERR "aha152x: caught software interrupt %d for " + "unknown controller.\n", irqno); return IRQ_NONE; } @@ -795,14 +796,13 @@ struct Scsi_Host *aha152x_probe_one(stru /* need to have host registered before triggering any interrupt */ /* find an empty slot. */ - for ( i = 0; i < ARRAY_SIZE(aha152x_host); ++i ) { - if ( aha152x_host[i] == NULL ) { + for (i = 0; i < ARRAY_SIZE(aha152x_host); i++) { + if (aha152x_host[i] == NULL) break; - } } /* no empty slots? */ - if ( i >= ARRAY_SIZE(aha152x_host) ) { + if (i >= ARRAY_SIZE(aha152x_host)) { printk(KERN_ERR "aha152x: too many hosts: %d\n", i + 1); return NULL; } @@ -957,8 +957,8 @@ void aha152x_release(struct Scsi_Host *s scsi_remove_host(shpnt); scsi_host_put(shpnt); - for ( i = 0; i < ARRAY_SIZE(aha152x_host); ++i ) { - if ( aha152x_host[i] == shpnt ) { + for (i = 0; i < ARRAY_SIZE(aha152x_host); i++) { + if (aha152x_host[i] == shpnt) { aha152x_host[i] = NULL; break; } @@ -1501,7 +1501,8 @@ static irqreturn_t intr(int irqno, void unsigned char rev, dmacntrl0; if (!shpnt) { - printk(KERN_ERR "aha152x: caught interrupt %d for unknown controller.\n", irqno); + printk(KERN_ERR "aha152x: caught interrupt %d for unknown " + "controller.\n", irqno); return IRQ_NONE; } @@ -3022,7 +3023,7 @@ static void show_queues(struct Scsi_Host Scsi_Cmnd *ptr; unsigned long flags; - if(!shpnt) + if (!shpnt) return; DO_LOCK(flags); @@ -3988,9 +3989,8 @@ static void __exit aha152x_exit(void) { int i; - for(i=0; i