PCI: Remove pci_ats_enabled()

Remove pci_ats_enabled().  There are no callers outside the ATS code
itself.  We don't need to check ats_cap, because if we don't find an ATS
capability, we'll never set ats_enabled.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
Bjorn Helgaas 2015-07-20 09:23:37 -05:00
parent a71f938f3a
commit f7ef1340bb
2 changed files with 3 additions and 5 deletions

View File

@ -43,7 +43,7 @@ int pci_enable_ats(struct pci_dev *dev, int ps)
if (!dev->ats_cap) if (!dev->ats_cap)
return -EINVAL; return -EINVAL;
if (WARN_ON(pci_ats_enabled(dev))) if (WARN_ON(dev->ats_enabled))
return -EBUSY; return -EBUSY;
if (ps < PCI_ATS_MIN_STU) if (ps < PCI_ATS_MIN_STU)
@ -80,7 +80,7 @@ void pci_disable_ats(struct pci_dev *dev)
struct pci_dev *pdev; struct pci_dev *pdev;
u16 ctrl; u16 ctrl;
if (WARN_ON(!pci_ats_enabled(dev))) if (WARN_ON(!dev->ats_enabled))
return; return;
if (atomic_read(&dev->ats_ref_cnt)) if (atomic_read(&dev->ats_ref_cnt))
@ -103,7 +103,7 @@ void pci_restore_ats_state(struct pci_dev *dev)
{ {
u16 ctrl; u16 ctrl;
if (!pci_ats_enabled(dev)) if (!dev->ats_enabled)
return; return;
ctrl = PCI_ATS_CTRL_ENABLE; ctrl = PCI_ATS_CTRL_ENABLE;

View File

@ -1303,13 +1303,11 @@ void pci_ats_init(struct pci_dev *dev);
int pci_enable_ats(struct pci_dev *dev, int ps); int pci_enable_ats(struct pci_dev *dev, int ps);
void pci_disable_ats(struct pci_dev *dev); void pci_disable_ats(struct pci_dev *dev);
int pci_ats_queue_depth(struct pci_dev *dev); int pci_ats_queue_depth(struct pci_dev *dev);
static inline int pci_ats_enabled(struct pci_dev *dev) { return dev->ats_cap && dev->ats_enabled; }
#else #else
static inline void pci_ats_init(struct pci_dev *d) { } static inline void pci_ats_init(struct pci_dev *d) { }
static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; } static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
static inline void pci_disable_ats(struct pci_dev *d) { } static inline void pci_disable_ats(struct pci_dev *d) { }
static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; } static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
static inline int pci_ats_enabled(struct pci_dev *d) { return 0; }
#endif #endif
void pci_cfg_access_lock(struct pci_dev *dev); void pci_cfg_access_lock(struct pci_dev *dev);