Re: [PATCH 4/6] pci/dmar/sriov: use physfn to search drhd for VF

From: Roland Dreier
Date: Thu Apr 08 2010 - 15:11:21 EST


> +#ifdef CONFIG_PCI_IOV
> + if (dev->is_virtfn)
> + dev = dev->physfn;
> +#endif

Seems we would prefer to avoid this ifdef... if we had a function like

struct pci_dev *pci_physfn(struct pci_dev *virtfn)

as an inline in <linux/pci.h> that just returns NULL if PCI_IOV is not
enabled, then we could write this as

if (dev->is_virtfn)
dev = pci_physfn(dev)

without any #ifdef.
--
Roland Dreier <rolandd@xxxxxxxxx> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/