Re: [PATCH 15/19 v2] tg3: remove unnecessary read of PCI_CAP_ID_EXP
From: David Miller <davem@davemloft.net>
Date: 2011-06-28 04:39:36
From: David Miller <davem@davemloft.net>
Date: 2011-06-28 04:39:36
From: "Matt Carlson" <redacted>, "Jon Mason" <jdmason@kudzu.us> Date: Mon, 27 Jun 2011 16:33:52 -0700
On Mon, Jun 27, 2011 at 03:56:50PM -0700, Jon Mason wrote:quoted
The PCIE capability offset is saved during PCI bus walking. Use the value from pci_dev instead of checking in the driver and saving it off the the driver specific structure. It will remove an unnecessary search in the PCI configuration space if this value is referenced instead of reacquiring it. v2 of the patch re-adds the PCI_EXPRESS flag and adds comments describing why it is necessary. Signed-off-by: Jon Mason <jdmason@kudzu.us>
...
Sorry to be a stickler, but can we convert all occurances of 'tp->pdev->pcie_cap' to pci_pcie_cap(tp->pdev)? If the PCI layer is taking control of that variable, the driver shouldn't be accessing it directly if it can help it.
I did this while adding this patch, thanks.