diff mbox

[6/8] PCI: Use pci_physfn() rather than looking up physfn by hand

Message ID 20150717213232.18379.64802.stgit@bhelgaas-glaptop2.roam.corp.google.com
State Superseded
Headers show

Commit Message

Bjorn Helgaas July 17, 2015, 9:32 p.m. UTC
Use the pci_physfn() helper rather than looking up physfn by hand.
No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/ats.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joerg Roedel July 20, 2015, 2:17 p.m. UTC | #1
On Fri, Jul 17, 2015 at 04:32:32PM -0500, Bjorn Helgaas wrote:
> Use the pci_physfn() helper rather than looking up physfn by hand.
> No functional change.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  drivers/pci/ats.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
> index fe59182..c35de8e 100644
> --- a/drivers/pci/ats.c
> +++ b/drivers/pci/ats.c
> @@ -53,9 +53,7 @@ int pci_enable_ats(struct pci_dev *dev, int ps)
>  
>  	ctrl = PCI_ATS_CTRL_ENABLE;
>  	if (dev->is_virtfn) {
> -		struct pci_dev *pdev = dev->physfn;
> -
> -		if (pdev->ats_stu != ps)
> +		if (pci_physfn(dev)->ats_stu != ps)
>  			return -EINVAL;
>  	} else {
>  		dev->ats_stu = ps;

Reviewed-by: Joerg Roedel <jroedel@suse.de>

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index fe59182..c35de8e 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -53,9 +53,7 @@  int pci_enable_ats(struct pci_dev *dev, int ps)
 
 	ctrl = PCI_ATS_CTRL_ENABLE;
 	if (dev->is_virtfn) {
-		struct pci_dev *pdev = dev->physfn;
-
-		if (pdev->ats_stu != ps)
+		if (pci_physfn(dev)->ats_stu != ps)
 			return -EINVAL;
 	} else {
 		dev->ats_stu = ps;