netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, jeff@garzik.org, gospo@redhat.com,
	Alexander Duyck <alexander.h.duyck@intel.com>
Subject: [net-next PATCH 17/26] igb: remove unnecessary adapter->hw calls when just hw-> will do.
Date: Sat, 07 Feb 2009 01:20:31 -0800	[thread overview]
Message-ID: <20090207092031.15697.88279.stgit@lost.foo-projects.org> (raw)
In-Reply-To: <20090207091504.15697.26667.stgit@lost.foo-projects.org>

From: Alexander Duyck <alexander.h.duyck@intel.com>

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>
---

 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 2d169a4..e3f521c 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,
 	mmio_len = pci_resource_len(pdev, 0);
 
 	err = -EIO;
-	adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
-	if (!adapter->hw.hw_addr)
+	hw->hw_addr = ioremap(mmio_start, mmio_len);
+	if (!hw->hw_addr)
 		goto err_ioremap;
 
 	netdev->netdev_ops = &igb_netdev_ops;
@@ -1357,9 +1357,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct igb_adapter *adapter = netdev_priv(netdev);
-#ifdef CONFIG_IGB_DCA
 	struct e1000_hw *hw = &adapter->hw;
-#endif
 	int err;
 
 	/* flush_scheduled work may reschedule our watchdog task, so
@@ -1392,9 +1390,9 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 
 	igb_free_queues(adapter);
 
-	iounmap(adapter->hw.hw_addr);
-	if (adapter->hw.flash_address)
-		iounmap(adapter->hw.flash_address);
+	iounmap(hw->hw_addr);
+	if (hw->flash_address)
+		iounmap(hw->flash_address);
 	pci_release_selected_regions(pdev, pci_select_bars(pdev,
 	                             IORESOURCE_MEM));
 
@@ -1784,7 +1782,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
 	rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
 
 	rctl |= E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_RDMTS_HALF |
-		(adapter->hw.mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
+		(hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
 
 	/*
 	 * 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)
 static int igb_set_mac(struct net_device *netdev, void *p)
 {
 	struct igb_adapter *adapter = netdev_priv(netdev);
+	struct e1000_hw *hw = &adapter->hw;
 	struct sockaddr *addr = p;
 
 	if (!is_valid_ether_addr(addr->sa_data))
 		return -EADDRNOTAVAIL;
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
-	memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len);
+	memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
 
-	adapter->hw.mac.ops.rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
+	hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
 
 	return 0;
 }
@@ -4140,7 +4139,7 @@ static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
 	struct e1000_hw *hw = &adapter->hw;
 	u32 vfta, index;
 
-	if ((adapter->hw.mng_cookie.status &
+	if ((hw->mng_cookie.status &
 	     E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
 	    (vid == adapter->mng_vlan_id))
 		return;


  parent reply	other threads:[~2009-02-07  9:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07  9:15 [net-next PATCH 01/26] igb: optomize/refactor receive path Jeff Kirsher
2009-02-07  9:15 ` [net-next PATCH 02/26] igb: move setting of buffsz out of repeated path in alloc_rx_buffers Jeff Kirsher
2009-02-07  9:15 ` [net-next PATCH 03/26] igb: move initialization of number of queues into set_interrupt_capability Jeff Kirsher
2009-02-07  9:16 ` [net-next PATCH 04/26] igb: remove check for needing an io port Jeff Kirsher
2009-02-07  9:16 ` [net-next PATCH 05/26] igb: add link check function Jeff Kirsher
2009-02-07  9:16 ` [net-next PATCH 06/26] igb: make dev_spec a union and remove dynamic allocation Jeff Kirsher
2009-02-07  9:17 ` [net-next PATCH 07/26] igb: read address from RAH/RAL instead of from EEPROM Jeff Kirsher
2009-02-07  9:17 ` [net-next PATCH 08/26] igb: rename phy ops Jeff Kirsher
2009-02-07  9:17 ` [net-next PATCH 09/26] igb: rename nvm ops Jeff Kirsher
2009-02-07  9:18 ` [net-next PATCH 10/26] igb: remove unused rx_hdr_split statistic Jeff Kirsher
2009-02-07  9:18 ` [net-next PATCH 11/26] igb: update feature flags supported in ethtool Jeff Kirsher
2009-02-07  9:18 ` [net-next PATCH 12/26] igb: update testing done by ethtool Jeff Kirsher
2009-02-07  9:19 ` [net-next PATCH 13/26] igb: add counter for dma out of sync errors Jeff Kirsher
2009-02-07  9:19 ` [net-next PATCH 14/26] igb: cleanup igb_netpoll to be more friendly with napi & GRO Jeff Kirsher
2009-02-07  9:19 ` [net-next PATCH 15/26] igb: remove redundant timer updates and cleanup watchdog_task Jeff Kirsher
2009-02-07  9:20 ` [net-next PATCH 16/26] igb: rename igb_update_mc_addr_list_82575 to not include the 82575 Jeff Kirsher
2009-02-07  9:20 ` Jeff Kirsher [this message]
2009-02-07  9:20 ` [net-next PATCH 18/26] igb: don't read eicr when responding to legacy interrupts Jeff Kirsher
2009-02-07  9:21 ` [net-next PATCH 19/26] igb: move get_hw_control within igb_resume Jeff Kirsher
2009-02-07  9:21 ` [net-next PATCH 20/26] igb: change pba size determination from if to switch statement Jeff Kirsher
2009-02-07  9:21 ` [net-next PATCH 21/26] igb: remove disable_av variable from mac_info struct Jeff Kirsher
2009-02-07  9:22 ` [net-next PATCH 22/26] igb: remove redundant count set and err_hw_init Jeff Kirsher
2009-02-07  9:22 ` [net-next PATCH 23/26] igb: update stats before doing reset in igb_down Jeff Kirsher
2009-02-07  9:22 ` [net-next PATCH 24/26] igb: fix two minor items found during code review Jeff Kirsher
2009-02-07  9:23 ` [net-next PATCH 25/26] igb: update version number and copyright dates Jeff Kirsher
2009-02-07  9:23 ` [net-next PATCH 26/26] igb: remove dead code in transmit routine Jeff Kirsher
2009-02-07 10:46 ` [net-next PATCH 01/26] igb: optomize/refactor receive path David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090207092031.15697.88279.stgit@lost.foo-projects.org \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).