* [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function
@ 2025-09-03 11:52 Leon Romanovsky
2025-09-03 16:08 ` Logan Gunthorpe
2025-09-03 22:03 ` Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Leon Romanovsky @ 2025-09-03 11:52 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Leon Romanovsky, linux-pci, Logan Gunthorpe
From: Leon Romanovsky <leonro@nvidia.com>
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 <leonro@nvidia.com>
---
drivers/pci/p2pdma.c | 3 +--
include/linux/pci-p2pdma.h | 5 -----
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 3fa1292c8d91..988e7788c68e 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -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
diff --git a/include/linux/pci-p2pdma.h b/include/linux/pci-p2pdma.h
index dea98baee5ce..b9ba63c40e51 100644
--- a/include/linux/pci-p2pdma.h
+++ b/include/linux/pci-p2pdma.h
@@ -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)
{
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function
2025-09-03 11:52 [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function Leon Romanovsky
@ 2025-09-03 16:08 ` Logan Gunthorpe
2025-09-03 22:03 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Logan Gunthorpe @ 2025-09-03 16:08 UTC (permalink / raw)
To: Leon Romanovsky, Bjorn Helgaas; +Cc: Leon Romanovsky, linux-pci
On 2025-09-03 05:52, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> 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 <leonro@nvidia.com>
Makes sense to me, thanks.
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function
2025-09-03 11:52 [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function Leon Romanovsky
2025-09-03 16:08 ` Logan Gunthorpe
@ 2025-09-03 22:03 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2025-09-03 22:03 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Bjorn Helgaas, Leon Romanovsky, linux-pci, Logan Gunthorpe
On Wed, Sep 03, 2025 at 02:52:56PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
>
> 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 <leonro@nvidia.com>
Applied to pci/p2pdma for v6.18, thanks!
> ---
> drivers/pci/p2pdma.c | 3 +--
> include/linux/pci-p2pdma.h | 5 -----
> 2 files changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index 3fa1292c8d91..988e7788c68e 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -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
> diff --git a/include/linux/pci-p2pdma.h b/include/linux/pci-p2pdma.h
> index dea98baee5ce..b9ba63c40e51 100644
> --- a/include/linux/pci-p2pdma.h
> +++ b/include/linux/pci-p2pdma.h
> @@ -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)
> {
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-03 22:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 11:52 [PATCH] PCI/P2PDMA: Reduce scope of pci_has_p2pmem function Leon Romanovsky
2025-09-03 16:08 ` Logan Gunthorpe
2025-09-03 22:03 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).