Patchwork [01/10] sky2: fix sparse warning

login
register
mail settings
Submitter stephen hemminger
Date Feb. 12, 2010, 4:57 p.m.
Message ID <20100212165937.579717088@vyatta.com>
Download mbox | patch
Permalink /patch/45192/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Feb. 12, 2010, 4:57 p.m.
Warning about hidden variable

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Patch

--- a/drivers/net/sky2.c	2010-02-11 09:15:11.429362380 -0800
+++ b/drivers/net/sky2.c	2010-02-11 09:15:20.407488037 -0800
@@ -3128,7 +3128,7 @@  static void sky2_reset(struct sky2_hw *h
 		/* check if PSMv2 was running before */
 		reg = sky2_pci_read16(hw, PSM_CONFIG_REG3);
 		if (reg & PCI_EXP_LNKCTL_ASPMC) {
-			int cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+			cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
 			/* restore the PCIe Link Control register */
 			sky2_pci_write16(hw, cap + PCI_EXP_LNKCTL, reg);
 		}