Skip to contentSkip to conversation

staging: dgnc: remove useless variable 'intr_count'

PATCH In review Daeseok Youn 2 participants 2 messages May 27, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/7 staging: dgnc: remove useless variable 'intr_count'

The 'intr_count' variable was used only for increasing. So the 'intr_count' variable is not useful for this driver.

---
 drivers/staging/dgnc/dgnc_cls.c    | 2 --
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 drivers/staging/dgnc/dgnc_neo.c    | 2 --
 3 files changed, 5 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +0 -2
index 46c050c..dcb808f 100644
@@ -760,8 +760,6 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
 
 	spin_lock_irqsave(&brd->bd_intr_lock, flags);
 
-	brd->intr_count++;
-
 	/*
 	 * Check the board's global interrupt offset to see if we
 	 * we actually do have an interrupt pending for us.
drivers/staging/dgnc/dgnc_driver.h +0 -1
index 95ec729..7ac33ed 100644
@@ -183,7 +183,6 @@ struct dgnc_board {
 	uint		nasync;		/* Number of ports on card */
 
 	uint		irq;		/* Interrupt request number */
-	ulong		intr_count;	/* Count of interrupts */
 	ulong		intr_modem;	/* Count of interrupts */
 	ulong		intr_tx;	/* Count of interrupts */
 	ulong		intr_rx;	/* Count of interrupts */
drivers/staging/dgnc/dgnc_neo.c +0 -2
index ba57e95..3f8bbb3 100644
@@ -926,8 +926,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
 	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
 		return IRQ_NONE;
 
-	brd->intr_count++;
-
 	/* Lock out the slow poller from running on this board. */
 	spin_lock_irqsave(&brd->bd_intr_lock, flags);
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 41 lines · Daeseok Youn

The 'intr_count' variable was used only for increasing. So the 'intr_count' variable is not useful for this driver.

---
 drivers/staging/dgnc/dgnc_cls.c    | 2 --
 drivers/staging/dgnc/dgnc_driver.h | 1 -
 drivers/staging/dgnc/dgnc_neo.c    | 2 --
 3 files changed, 5 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +0 -2
index 46c050c..dcb808f 100644
@@ -760,8 +760,6 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)
 
 	spin_lock_irqsave(&brd->bd_intr_lock, flags);
 
-	brd->intr_count++;
-
 	/*
 	 * Check the board's global interrupt offset to see if we
 	 * we actually do have an interrupt pending for us.
drivers/staging/dgnc/dgnc_driver.h +0 -1
index 95ec729..7ac33ed 100644
@@ -183,7 +183,6 @@ struct dgnc_board {
 	uint		nasync;		/* Number of ports on card */
 
 	uint		irq;		/* Interrupt request number */
-	ulong		intr_count;	/* Count of interrupts */
 	ulong		intr_modem;	/* Count of interrupts */
 	ulong		intr_tx;	/* Count of interrupts */
 	ulong		intr_rx;	/* Count of interrupts */
drivers/staging/dgnc/dgnc_neo.c +0 -0
index ba57e95..3f8bbb3 100644

drivers/staging/dgnc/dgnc_neo.c static irqreturn_t neo_intr(int irq, void *voidbrd) · line 931

Quoted 8 lines
drivers/staging/dgnc/dgnc_neo.c +0 -2
@@ -926,8 +926,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
 	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
 		return IRQ_NONE;
 
-	brd->intr_count++;
-
 	/* Lock out the slow poller from running on this board. */
 	spin_lock_irqsave(&brd->bd_intr_lock, flags);
 

Good catch. intr_count is set and incremented but never read.

Thanks,
Luis