Skip to contentSkip to conversation

i40evf: fix compiler warning of unused variable

PATCH New Jeff Kirsher 2 participants 3 messages Oct 4, 2015 – Oct 15, 2015

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

PATCH v2 1/1 i40evf: fix compiler warning of unused variable

From: Jesse Brandeburg <[email protected]>

Compiler complained of an unused variable, which the driver was just using to store the result of a rd32 which is used to clear a register unconditionally. Just drop the unused variable and re-use one.

---
v2: Fix title since Jesse used the same title for two difference patches

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -4
index e5e132a..3abd36d 100644
@@ -305,12 +305,10 @@ static irqreturn_t i40evf_msix_aq(int irq, void *data)
 	struct i40evf_adapter *adapter = netdev_priv(netdev);
 	struct i40e_hw *hw = &adapter->hw;
 	u32 val;
-	u32 ena_mask;
 
-	/* handle non-queue interrupts */
+	/* handle non-queue interrupts, these reads clear the registers */
 	val = rd32(hw, I40E_VFINT_ICR01);
-	ena_mask = rd32(hw, I40E_VFINT_ICR0_ENA1);
-
+	val = rd32(hw, I40E_VFINT_ICR0_ENA1);
 
 	val = rd32(hw, I40E_VFINT_DYN_CTL01);
 	val = val | I40E_VFINT_DYN_CTL01_CLEARPBA_MASK;
Signature · 1 line
2.4.3
#1 lore raw

PATCH v2 1/1 i40evf: fix compiler warning of unused variable

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jeff Kirsher
Sent: Sunday, October 04, 2015 1:10 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH v2] i40evf: fix compiler warning of unused variable

From: Jesse Brandeburg <[email protected]>

Compiler complained of an unused variable, which the driver was just using to store the result of a rd32 which is used to clear a register unconditionally. Just drop the unused variable and re-use one.

Quoted 6 lines

---
v2: Fix title since Jesse used the same title for two difference patches

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
#2 lore raw

PATCH v2 1/1 i40evf: fix compiler warning of unused variable

In reply to Jeff Kirsher
Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jeff Kirsher
Sent: Sunday, October 04, 2015 1:10 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH v2] i40evf: fix compiler warning of unused variable

From: Jesse Brandeburg <[email protected]>

Compiler complained of an unused variable, which the driver was just using to store the result of a rd32 which is used to clear a register unconditionally. Just drop the unused variable and re-use one.

Quoted 6 lines

---
v2: Fix title since Jesse used the same title for two difference patches

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch code changes correctly applied, compiler does not issue unused variable warning at compile time.