Commit 81125860 authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

cciss: cleanup interrupt_not_for_us

cciss: cleanup interrupt_not_for_us
In the case of MSI/MSIX interrutps, we don't need to check
if the interrupt is for us, and in the case of the intx interrupt
handler, when checking if the interrupt is for us, we don't need
to check if we're using MSI/MSIX, we know we're not.
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent b2a4a43d
...@@ -3376,8 +3376,7 @@ static inline int interrupt_pending(ctlr_info_t *h) ...@@ -3376,8 +3376,7 @@ static inline int interrupt_pending(ctlr_info_t *h)
static inline long interrupt_not_for_us(ctlr_info_t *h) static inline long interrupt_not_for_us(ctlr_info_t *h)
{ {
return !(h->msi_vector || h->msix_vector) && return ((h->access.intr_pending(h) == 0) ||
((h->access.intr_pending(h) == 0) ||
(h->interrupts_enabled == 0)); (h->interrupts_enabled == 0));
} }
...@@ -3470,10 +3469,6 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id) ...@@ -3470,10 +3469,6 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id)
if (interrupt_not_for_us(h)) if (interrupt_not_for_us(h))
return IRQ_NONE; return IRQ_NONE;
/*
* If there are completed commands in the completion queue,
* we had better do something about it.
*/
spin_lock_irqsave(&h->lock, flags); spin_lock_irqsave(&h->lock, flags);
while (interrupt_pending(h)) { while (interrupt_pending(h)) {
raw_tag = get_next_completion(h); raw_tag = get_next_completion(h);
...@@ -3484,7 +3479,6 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id) ...@@ -3484,7 +3479,6 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id)
raw_tag = process_nonindexed_cmd(h, raw_tag); raw_tag = process_nonindexed_cmd(h, raw_tag);
} }
} }
spin_unlock_irqrestore(&h->lock, flags); spin_unlock_irqrestore(&h->lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -3498,12 +3492,6 @@ static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id) ...@@ -3498,12 +3492,6 @@ static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id)
unsigned long flags; unsigned long flags;
u32 raw_tag; u32 raw_tag;
if (interrupt_not_for_us(h))
return IRQ_NONE;
/*
* If there are completed commands in the completion queue,
* we had better do something about it.
*/
spin_lock_irqsave(&h->lock, flags); spin_lock_irqsave(&h->lock, flags);
raw_tag = get_next_completion(h); raw_tag = get_next_completion(h);
while (raw_tag != FIFO_EMPTY) { while (raw_tag != FIFO_EMPTY) {
...@@ -3512,7 +3500,6 @@ static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id) ...@@ -3512,7 +3500,6 @@ static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id)
else else
raw_tag = process_nonindexed_cmd(h, raw_tag); raw_tag = process_nonindexed_cmd(h, raw_tag);
} }
spin_unlock_irqrestore(&h->lock, flags); spin_unlock_irqrestore(&h->lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment