Messages in this thread Patch in this message | | | From | Lu Baolu <> | Subject | [PATCH v8 1/7] PCI: Add dev_is_untrusted helper | Date | Fri, 30 Aug 2019 15:17:12 +0800 |
| |
There are several places in the kernel where it is necessary to check whether a device is a pci untrusted device. Add a helper to simplify the callers.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> --- include/linux/pci.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h index 82e4cd1b7ac3..6c107eb381ac 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1029,6 +1029,7 @@ void pcibios_setup_bridge(struct pci_bus *bus, unsigned long type); void pci_sort_breadthfirst(void); #define dev_is_pci(d) ((d)->bus == &pci_bus_type) #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) +#define dev_is_untrusted(d) ((dev_is_pci(d) ? to_pci_dev(d)->untrusted : false)) /* Generic PCI functions exported to card drivers */ @@ -1768,6 +1769,7 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } #define dev_is_pci(d) (false) #define dev_is_pf(d) (false) +#define dev_is_untrusted(d) (false) static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) { return false; } static inline int pci_irqd_intx_xlate(struct irq_domain *d, -- 2.17.1
| |