Commit f66626e4 authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman

Staging: slicoss: Refactor code by introducing new function slic_interrupt_card_up()

This patch fixes the following checkpatch.pl warning in slicoss.c:
WARNING: Too many leading tabs - consider code refactoring
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f6876cf
......@@ -2619,20 +2619,9 @@ static void slic_xmit_complete(struct adapter *adapter)
adapter->max_isr_xmits = max(adapter->max_isr_xmits, frames);
}
static irqreturn_t slic_interrupt(int irq, void *dev_id)
static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
struct net_device *dev)
{
struct net_device *dev = (struct net_device *)dev_id;
struct adapter *adapter = netdev_priv(dev);
u32 isr;
if ((adapter->pshmem) && (adapter->pshmem->isr)) {
slic_reg32_write(&adapter->slic_regs->slic_icr,
ICR_INT_MASK, FLUSH);
isr = adapter->isrcopy = adapter->pshmem->isr;
adapter->pshmem->isr = 0;
adapter->num_isrs++;
switch (adapter->card->state) {
case CARD_UP:
if (isr & ~ISR_IO) {
if (isr & ISR_ERR) {
adapter->error_interrupts++;
......@@ -2644,18 +2633,15 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
struct slic_rcvqueue *rcvq =
&adapter->rcvqueue;
adapter->
error_rmiss_interrupts++;
adapter->error_rmiss_interrupts++;
if (!rcvq->errors)
rcv_count = rcvq->count;
pre_count = rcvq->count;
errors = rcvq->errors;
while (rcvq->count <
SLIC_RCVQ_FILLTHRESH) {
count =
slic_rcvqueue_fill
(adapter);
while (rcvq->count < SLIC_RCVQ_FILLTHRESH) {
count = slic_rcvqueue_fill(adapter);
if (!count)
break;
}
......@@ -2675,8 +2661,8 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
slic_link_event_handler(adapter);
}
if ((isr & ISR_UPC) ||
(isr & ISR_UPCERR) || (isr & ISR_UPCBSY)) {
if ((isr & ISR_UPC) || (isr & ISR_UPCERR) ||
(isr & ISR_UPCBSY)) {
adapter->upr_interrupts++;
slic_upr_request_complete(adapter, isr);
}
......@@ -2691,6 +2677,24 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
adapter->xmit_interrupts++;
slic_xmit_complete(adapter);
}
}
static irqreturn_t slic_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct adapter *adapter = netdev_priv(dev);
u32 isr;
if ((adapter->pshmem) && (adapter->pshmem->isr)) {
slic_reg32_write(&adapter->slic_regs->slic_icr,
ICR_INT_MASK, FLUSH);
isr = adapter->isrcopy = adapter->pshmem->isr;
adapter->pshmem->isr = 0;
adapter->num_isrs++;
switch (adapter->card->state) {
case CARD_UP:
slic_interrupt_card_up(isr, adapter, dev);
break;
case CARD_DOWN:
......
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