All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/cma: fix stray newline in auto-generated CMA area name
@ 2026-08-11  0:34 Ivy Lopez
  2026-08-11  7:16 ` David Hildenbrand (Arm)
  0 siblings, 1 reply; 2+ messages in thread
From: Ivy Lopez @ 2026-08-11  0:34 UTC (permalink / raw)
  To: akpm, david
  Cc: ljs, liam, vbabka, rppt, surenb, mhocko, linux-mm, linux-kernel,
	Ivy Lopez

When no explicit name is provided, cma_new_area() falls back to
generating one via snprintf(), but the format string contains an
embedded newline: "cma%d\n". This name is used as-is for the area's
sysfs entry (cma_sysfs.c) and debugfs directory (cma_debug.c), so
every auto-named CMA area ends up with a newline embedded in its
sysfs/debugfs name.

Drop the stray newline and the extra space after the size argument.

Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
---
 mm/cma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/cma.c b/mm/cma.c
index a13ce4999b39..092cbb8f27ec 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -240,7 +240,7 @@ static int __init cma_new_area(const char *name, phys_addr_t size,
 	if (name)
 		strscpy(cma->name, name);
 	else
-		snprintf(cma->name, CMA_MAX_NAME,  "cma%d\n", cma_area_count);
+		snprintf(cma->name, CMA_MAX_NAME, "cma%d", cma_area_count);
 
 	cma->available_count = cma->count = size >> PAGE_SHIFT;
 	cma->order_per_bit = order_per_bit;
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/cma: fix stray newline in auto-generated CMA area name
  2026-08-11  0:34 [PATCH] mm/cma: fix stray newline in auto-generated CMA area name Ivy Lopez
@ 2026-08-11  7:16 ` David Hildenbrand (Arm)
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-11  7:16 UTC (permalink / raw)
  To: Ivy Lopez, akpm
  Cc: ljs, liam, vbabka, rppt, surenb, mhocko, linux-mm, linux-kernel

On 8/11/26 02:34, Ivy Lopez wrote:
> When no explicit name is provided, cma_new_area() falls back to
> generating one via snprintf(), but the format string contains an
> embedded newline: "cma%d\n". This name is used as-is for the area's
> sysfs entry (cma_sysfs.c) and debugfs directory (cma_debug.c), so
> every auto-named CMA area ends up with a newline embedded in its
> sysfs/debugfs name.
> 
> Drop the stray newline and the extra space after the size argument.
> 
> Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
> ---
>  mm/cma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/cma.c b/mm/cma.c
> index a13ce4999b39..092cbb8f27ec 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -240,7 +240,7 @@ static int __init cma_new_area(const char *name, phys_addr_t size,
>  	if (name)
>  		strscpy(cma->name, name);
>  	else
> -		snprintf(cma->name, CMA_MAX_NAME,  "cma%d\n", cma_area_count);
> +		snprintf(cma->name, CMA_MAX_NAME, "cma%d", cma_area_count);
>  
>  	cma->available_count = cma->count = size >> PAGE_SHIFT;
>  	cma->order_per_bit = order_per_bit;

Hi,

please see

https://lore.kernel.org/r/20260810093215.91419-1-hongfu.li@linux.dev

-- 
Cheers,

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-11  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11  0:34 [PATCH] mm/cma: fix stray newline in auto-generated CMA area name Ivy Lopez
2026-08-11  7:16 ` David Hildenbrand (Arm)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.