X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=drivers%2Fscsi%2Faacraid%2Fcommsup.c;h=3f27419c66af6c7abac2af838304b3650a8756c8;hp=9f9f4aae23c02a498ad55a6af9b2a9cd249cffe1;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57 diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 9f9f4aae2..3f27419c6 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -229,8 +229,7 @@ void aac_fib_init(struct fib *fibptr) static void fib_dealloc(struct fib * fibptr) { struct hw_fib *hw_fib = fibptr->hw_fib; - if(hw_fib->header.StructType != FIB_MAGIC) - BUG(); + BUG_ON(hw_fib->header.StructType != FIB_MAGIC); hw_fib->header.XferState = 0; } @@ -472,7 +471,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, spin_lock_irqsave(q->lock, qflags); if (dev->new_comm_interface) { unsigned long count = 10000000L; /* 50 seconds */ - list_add_tail(&fibptr->queue, &q->pendingq); q->numpending++; spin_unlock_irqrestore(q->lock, qflags); while (aac_adapter_send(fibptr) != 0) { @@ -481,7 +479,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, spin_unlock_irqrestore(&fibptr->event_lock, flags); spin_lock_irqsave(q->lock, qflags); q->numpending--; - list_del(&fibptr->queue); spin_unlock_irqrestore(q->lock, qflags); return -ETIMEDOUT; } @@ -492,7 +489,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, unsigned long nointr = 0; aac_queue_get( dev, &index, AdapNormCmdQueue, hw_fib, 1, fibptr, &nointr); - list_add_tail(&fibptr->queue, &q->pendingq); q->numpending++; *(q->headers.producer) = cpu_to_le32(index + 1); spin_unlock_irqrestore(q->lock, qflags); @@ -520,7 +516,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, if (--count == 0) { spin_lock_irqsave(q->lock, qflags); q->numpending--; - list_del(&fibptr->queue); spin_unlock_irqrestore(q->lock, qflags); if (wait == -1) { printk(KERN_ERR "aacraid: aac_fib_send: first asynchronous command timed out.\n" @@ -534,8 +529,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, } } else down(&fibptr->event_wait); - if(fibptr->done == 0) - BUG(); + BUG_ON(fibptr->done == 0); if((fibptr->flags & FIB_CONTEXT_FLAG_TIMED_OUT)){ return -ETIMEDOUT; @@ -1214,7 +1208,7 @@ int aac_command_thread(void *data) * since the last read off * the queue? */ - if ((time_now - time_last) > 120) { + if ((time_now - time_last) > aif_timeout) { entry = entry->next; aac_close_fib_context(dev, fibctx); continue;