netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net/benet: Identify interface type in advance
@ 2013-10-25  8:02 Gavin Shan
  2013-10-25  8:02 ` [PATCH 2/2] net/benet: Make lancer_wait_ready() static Gavin Shan
  2013-10-27 14:22 ` [PATCH 1/2] net/benet: Identify interface type in advance Sathya Perla
  0 siblings, 2 replies; 3+ messages in thread
From: Gavin Shan @ 2013-10-25  8:02 UTC (permalink / raw)
  To: netdev; +Cc: sathya.perla, Gavin Shan

Function be_map_pci_bars() is being called in be_ctrl_init(). Since
be_ctrl_init() has fetched the value of PCI config register 0x58,
we needn't access the same register in be_map_pci_bars() again to
incur unnecessary PCI config access.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2c38cc4..1a799d2 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3960,11 +3960,6 @@ static int be_roce_map_pci_bars(struct be_adapter *adapter)
 static int be_map_pci_bars(struct be_adapter *adapter)
 {
 	u8 __iomem *addr;
-	u32 sli_intf;
-
-	pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, &sli_intf);
-	adapter->if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
-				SLI_INTF_IF_TYPE_SHIFT;
 
 	if (BEx_chip(adapter) && be_physfn(adapter)) {
 		adapter->csr = pci_iomap(adapter->pdev, 2, 0);
@@ -4011,7 +4006,9 @@ static int be_ctrl_init(struct be_adapter *adapter)
 
 	pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, &sli_intf);
 	adapter->sli_family = (sli_intf & SLI_INTF_FAMILY_MASK) >>
-				 SLI_INTF_FAMILY_SHIFT;
+				SLI_INTF_FAMILY_SHIFT;
+	adapter->if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
+				SLI_INTF_IF_TYPE_SHIFT;
 	adapter->virtfn = (sli_intf & SLI_INTF_FT_MASK) ? 1 : 0;
 
 	status = be_map_pci_bars(adapter);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-27 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25  8:02 [PATCH 1/2] net/benet: Identify interface type in advance Gavin Shan
2013-10-25  8:02 ` [PATCH 2/2] net/benet: Make lancer_wait_ready() static Gavin Shan
2013-10-27 14:22 ` [PATCH 1/2] net/benet: Identify interface type in advance Sathya Perla

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