[PATCH v2 6/9] mm: cma: Export cma_get_name

Maxime Ripard posted 9 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v2 6/9] mm: cma: Export cma_get_name
Posted by Maxime Ripard 1 month, 1 week ago
The CMA dma-buf heap uses the cma_get_name() function to get the name of
the heap instance it's going to create.

However, this function is not exported. Since we want to turn the CMA
heap into a module, let's export it.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 mm/cma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/cma.c b/mm/cma.c
index be142b473f3bd41b9c7d8ba4397f018f6993d962..550effb9c4e01cc488b5744fe61d55a5b70a6d6c 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -50,10 +50,11 @@ unsigned long cma_get_size(const struct cma *cma)
 
 const char *cma_get_name(const struct cma *cma)
 {
 	return cma->name;
 }
+EXPORT_SYMBOL_GPL(cma_get_name);
 
 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma,
 					     unsigned int align_order)
 {
 	if (align_order <= cma->order_per_bit)

-- 
2.53.0
Re: [PATCH v2 6/9] mm: cma: Export cma_get_name
Posted by David Hildenbrand (Arm) 1 month, 1 week ago
On 2/27/26 14:15, Maxime Ripard wrote:
> The CMA dma-buf heap uses the cma_get_name() function to get the name of
> the heap instance it's going to create.
> 
> However, this function is not exported. Since we want to turn the CMA
> heap into a module, let's export it.
> 
> Reviewed-by: T.J. Mercier <tjmercier@google.com>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  mm/cma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/cma.c b/mm/cma.c
> index be142b473f3bd41b9c7d8ba4397f018f6993d962..550effb9c4e01cc488b5744fe61d55a5b70a6d6c 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -50,10 +50,11 @@ unsigned long cma_get_size(const struct cma *cma)
>  
>  const char *cma_get_name(const struct cma *cma)
>  {
>  	return cma->name;
>  }
> +EXPORT_SYMBOL_GPL(cma_get_name);

No real reason to not squash this patch into #5, right?

-- 
Cheers,

David
Re: [PATCH v2 6/9] mm: cma: Export cma_get_name
Posted by Maxime Ripard 1 month ago
Hi,

On Fri, Feb 27, 2026 at 09:43:12PM +0100, David Hildenbrand (Arm) wrote:
> On 2/27/26 14:15, Maxime Ripard wrote:
> > The CMA dma-buf heap uses the cma_get_name() function to get the name of
> > the heap instance it's going to create.
> > 
> > However, this function is not exported. Since we want to turn the CMA
> > heap into a module, let's export it.
> > 
> > Reviewed-by: T.J. Mercier <tjmercier@google.com>
> > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > ---
> >  mm/cma.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/mm/cma.c b/mm/cma.c
> > index be142b473f3bd41b9c7d8ba4397f018f6993d962..550effb9c4e01cc488b5744fe61d55a5b70a6d6c 100644
> > --- a/mm/cma.c
> > +++ b/mm/cma.c
> > @@ -50,10 +50,11 @@ unsigned long cma_get_size(const struct cma *cma)
> >  
> >  const char *cma_get_name(const struct cma *cma)
> >  {
> >  	return cma->name;
> >  }
> > +EXPORT_SYMBOL_GPL(cma_get_name);
> 
> No real reason to not squash this patch into #5, right?

I was assuming it was not really the same "category" of the API than
alloc/free, so the reviews might not be the same (like they weren't for
dma_contiguous_default_area). But I guess it also makes sense to squash
both.

I'll update the series

Thanks!