diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-02-06 18:20:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-07 05:43:13 -0500 |
commit | 28b0759c224cad4ae8f5ed47f5af862dd2d1e1ed (patch) | |
tree | c99545bcc4733e2a1b93c8fa97dd6dc9ea14ed8c /drivers/net/igb | |
parent | 8a900862a2402565564ddcc3c6ecefb1c239d7e1 (diff) |
igb: remove unnecessary adapter->hw calls when just hw-> will do.
There were several spots in the code making calls to adapter->hw when they
could have just been accessing hw-> directly. I cleaned up the spots where
this was visibly apparent.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb_main.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 2d169a45c425..e3f521ccf9d5 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1096,8 +1096,8 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1096 | mmio_len = pci_resource_len(pdev, 0); | 1096 | mmio_len = pci_resource_len(pdev, 0); |
1097 | 1097 | ||
1098 | err = -EIO; | 1098 | err = -EIO; |
1099 | adapter->hw.hw_addr = ioremap(mmio_start, mmio_len); | 1099 | hw->hw_addr = ioremap(mmio_start, mmio_len); |
1100 | if (!adapter->hw.hw_addr) | 1100 | if (!hw->hw_addr) |
1101 | goto err_ioremap; | 1101 | goto err_ioremap; |
1102 | 1102 | ||
1103 | netdev->netdev_ops = &igb_netdev_ops; | 1103 | netdev->netdev_ops = &igb_netdev_ops; |
@@ -1357,9 +1357,7 @@ static void __devexit igb_remove(struct pci_dev *pdev) | |||
1357 | { | 1357 | { |
1358 | struct net_device *netdev = pci_get_drvdata(pdev); | 1358 | struct net_device *netdev = pci_get_drvdata(pdev); |
1359 | struct igb_adapter *adapter = netdev_priv(netdev); | 1359 | struct igb_adapter *adapter = netdev_priv(netdev); |
1360 | #ifdef CONFIG_IGB_DCA | ||
1361 | struct e1000_hw *hw = &adapter->hw; | 1360 | struct e1000_hw *hw = &adapter->hw; |
1362 | #endif | ||
1363 | int err; | 1361 | int err; |
1364 | 1362 | ||
1365 | /* flush_scheduled work may reschedule our watchdog task, so | 1363 | /* flush_scheduled work may reschedule our watchdog task, so |
@@ -1392,9 +1390,9 @@ static void __devexit igb_remove(struct pci_dev *pdev) | |||
1392 | 1390 | ||
1393 | igb_free_queues(adapter); | 1391 | igb_free_queues(adapter); |
1394 | 1392 | ||
1395 | iounmap(adapter->hw.hw_addr); | 1393 | iounmap(hw->hw_addr); |
1396 | if (adapter->hw.flash_address) | 1394 | if (hw->flash_address) |
1397 | iounmap(adapter->hw.flash_address); | 1395 | iounmap(hw->flash_address); |
1398 | pci_release_selected_regions(pdev, pci_select_bars(pdev, | 1396 | pci_release_selected_regions(pdev, pci_select_bars(pdev, |
1399 | IORESOURCE_MEM)); | 1397 | IORESOURCE_MEM)); |
1400 | 1398 | ||
@@ -1784,7 +1782,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1784 | rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC); | 1782 | rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC); |
1785 | 1783 | ||
1786 | rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_RDMTS_HALF | | 1784 | rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_RDMTS_HALF | |
1787 | (adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT); | 1785 | (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT); |
1788 | 1786 | ||
1789 | /* | 1787 | /* |
1790 | * enable stripping of CRC. It's unlikely this will break BMC | 1788 | * enable stripping of CRC. It's unlikely this will break BMC |
@@ -2176,15 +2174,16 @@ static void igb_clean_all_rx_rings(struct igb_adapter *adapter) | |||
2176 | static int igb_set_mac(struct net_device *netdev, void *p) | 2174 | static int igb_set_mac(struct net_device *netdev, void *p) |
2177 | { | 2175 | { |
2178 | struct igb_adapter *adapter = netdev_priv(netdev); | 2176 | struct igb_adapter *adapter = netdev_priv(netdev); |
2177 | struct e1000_hw *hw = &adapter->hw; | ||
2179 | struct sockaddr *addr = p; | 2178 | struct sockaddr *addr = p; |
2180 | 2179 | ||
2181 | if (!is_valid_ether_addr(addr->sa_data)) | 2180 | if (!is_valid_ether_addr(addr->sa_data)) |
2182 | return -EADDRNOTAVAIL; | 2181 | return -EADDRNOTAVAIL; |
2183 | 2182 | ||
2184 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 2183 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
2185 | memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len); | 2184 | memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len); |
2186 | 2185 | ||
2187 | adapter->hw.mac.ops.rar_set(&adapter->hw, adapter->hw.mac.addr, 0); | 2186 | hw->mac.ops.rar_set(hw, hw->mac.addr, 0); |
2188 | 2187 | ||
2189 | return 0; | 2188 | return 0; |
2190 | } | 2189 | } |
@@ -4140,7 +4139,7 @@ static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
4140 | struct e1000_hw *hw = &adapter->hw; | 4139 | struct e1000_hw *hw = &adapter->hw; |
4141 | u32 vfta, index; | 4140 | u32 vfta, index; |
4142 | 4141 | ||
4143 | if ((adapter->hw.mng_cookie.status & | 4142 | if ((hw->mng_cookie.status & |
4144 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && | 4143 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && |
4145 | (vid == adapter->mng_vlan_id)) | 4144 | (vid == adapter->mng_vlan_id)) |
4146 | return; | 4145 | return; |