PCI/P2PDMA: Reduce scope of pci_has_p2pmem function
Subsystems (2)
PATCH 1/1 PCI/P2PDMA: Reduce scope of pci_has_p2pmem function
From: Leon Romanovsky <[email protected]>
pci_has_p2pmem() function is not used outside of p2pdma.c and there is no need in EXPORT_SYMBOL_GPL for this function at all.
Signed-off-by Leon Romanovsky <[email protected]>
--- drivers/pci/p2pdma.c | 3 +-- include/linux/pci-p2pdma.h | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/pci/p2pdma.c +1 -2
@@ -787,7 +787,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;
@@ -799,7 +799,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
include/linux/pci-p2pdma.h +0 -5
@@ -71,7 +71,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);
@@ -101,10 +100,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) {
Signature · 1 line
2.51.0
Quoted 6 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
pci_has_p2pmem()function is not used outside ofp2pdma.cand there is no need inEXPORT_SYMBOL_GPLfor this function at all.Signed-off-by Leon Romanovsky <[email protected]>
Makes sense to me, thanks.
Reviewed-by Logan Gunthorpe <[email protected]>
Bjorn Helgaas
AppliedQuoted 6 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
pci_has_p2pmem()function is not used outside ofp2pdma.cand there is no need inEXPORT_SYMBOL_GPLfor this function at all.Signed-off-by Leon Romanovsky <[email protected]>
Applied to pci/p2pdma for v6.18, thanks!
Quoted 52 lines
--- drivers/pci/p2pdma.c | 3 +-- include/linux/pci-p2pdma.h | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-)drivers/pci/p2pdma.c +1
-2@@ -787,7 +787,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;@@ -799,7 +799,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 include/linux/pci-p2pdma.h +0
-5@@ -71,7 +71,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);@@ -101,10 +100,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) {Signature · 1 line
2.51.0