]> www.infradead.org Git - users/hch/misc.git/commitdiff
PCI/P2PDMA: Reduce scope of pci_has_p2pmem()
authorLeon Romanovsky <leonro@nvidia.com>
Wed, 3 Sep 2025 11:52:56 +0000 (14:52 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 3 Sep 2025 22:01:39 +0000 (17:01 -0500)
pci_has_p2pmem() is not used outside of p2pdma.c, and there is no need to
export it for use by modules.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://patch.msgid.link/d40f3f1decf54c9236bc38b48a6aae612a5c182f.1756900291.git.leon@kernel.org
drivers/pci/p2pdma.c
include/linux/pci-p2pdma.h

index 1cb5e423eed4f53159f7690f64b5094a02492172..78e108e47254ab629edb4eb7ef438a1cdca43fad 100644 (file)
@@ -738,7 +738,7 @@ EXPORT_SYMBOL_GPL(pci_p2pdma_distance_many);
  * pci_has_p2pmem - check if a given PCI device has published any p2pmem
  * @pdev: PCI device to check
  */
-bool pci_has_p2pmem(struct pci_dev *pdev)
+static bool pci_has_p2pmem(struct pci_dev *pdev)
 {
        struct pci_p2pdma *p2pdma;
        bool res;
@@ -750,7 +750,6 @@ bool pci_has_p2pmem(struct pci_dev *pdev)
 
        return res;
 }
-EXPORT_SYMBOL_GPL(pci_has_p2pmem);
 
 /**
  * pci_p2pmem_find_many - find a peer-to-peer DMA memory device compatible with
index 075c20b161d9883384b13c4f14611e3aa1f443ea..951f81a38f3afec175d0acc80b87987bd6ecc8a5 100644 (file)
@@ -21,7 +21,6 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
                u64 offset);
 int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
                             int num_clients, bool verbose);
-bool pci_has_p2pmem(struct pci_dev *pdev);
 struct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients);
 void *pci_alloc_p2pmem(struct pci_dev *pdev, size_t size);
 void pci_free_p2pmem(struct pci_dev *pdev, void *addr, size_t size);
@@ -45,10 +44,6 @@ static inline int pci_p2pdma_distance_many(struct pci_dev *provider,
 {
        return -1;
 }
-static inline bool pci_has_p2pmem(struct pci_dev *pdev)
-{
-       return false;
-}
 static inline struct pci_dev *pci_p2pmem_find_many(struct device **clients,
                                                   int num_clients)
 {