Skip to content

Commit 54dbd2a

Browse files
rleonbjorn-helgaas
authored andcommitted
PCI/P2PDMA: Reduce scope of pci_has_p2pmem()
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
1 parent 6238784 commit 54dbd2a

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/pci/p2pdma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ EXPORT_SYMBOL_GPL(pci_p2pdma_distance_many);
738738
* pci_has_p2pmem - check if a given PCI device has published any p2pmem
739739
* @pdev: PCI device to check
740740
*/
741-
bool pci_has_p2pmem(struct pci_dev *pdev)
741+
static bool pci_has_p2pmem(struct pci_dev *pdev)
742742
{
743743
struct pci_p2pdma *p2pdma;
744744
bool res;
@@ -750,7 +750,6 @@ bool pci_has_p2pmem(struct pci_dev *pdev)
750750

751751
return res;
752752
}
753-
EXPORT_SYMBOL_GPL(pci_has_p2pmem);
754753

755754
/**
756755
* pci_p2pmem_find_many - find a peer-to-peer DMA memory device compatible with

include/linux/pci-p2pdma.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
2121
u64 offset);
2222
int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
2323
int num_clients, bool verbose);
24-
bool pci_has_p2pmem(struct pci_dev *pdev);
2524
struct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients);
2625
void *pci_alloc_p2pmem(struct pci_dev *pdev, size_t size);
2726
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,
4544
{
4645
return -1;
4746
}
48-
static inline bool pci_has_p2pmem(struct pci_dev *pdev)
49-
{
50-
return false;
51-
}
5247
static inline struct pci_dev *pci_p2pmem_find_many(struct device **clients,
5348
int num_clients)
5449
{

0 commit comments

Comments
 (0)