* [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
@ 2026-08-10 9:32 Hongfu Li
2026-08-10 9:38 ` David Hildenbrand (Arm)
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Hongfu Li @ 2026-08-10 9:32 UTC (permalink / raw)
To: akpm, david, ljs, liam, vbabka, rppt, surenb, mhocko
Cc: linux-mm, linux-kernel, hongfu.li, Hongfu Li
From: Hongfu Li <lihongfu@kylinos.cn>
When no name is supplied, cma_new_area() generates names with format
"cma%d\n", introducing an unintended newline character ('\n') in the
CMA name.
Most CMA regions are created with explicit names, so this path is
seldom hit. The newline only creates cosmetic noise in debug logs,
traces and debugfs with no functional impact.
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
mm/cma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/cma.c b/mm/cma.c
index a7929c758df1..a10ea37a261d 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -242,7 +242,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.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
2026-08-10 9:32 [PATCH] mm/cma: remove stray newline from auto-generated CMA area name Hongfu Li
@ 2026-08-10 9:38 ` David Hildenbrand (Arm)
2026-08-10 11:24 ` Lorenzo Stoakes (ARM)
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-10 9:38 UTC (permalink / raw)
To: Hongfu Li, akpm, ljs, liam, vbabka, rppt, surenb, mhocko
Cc: linux-mm, linux-kernel, Hongfu Li
On 8/10/26 11:32, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> When no name is supplied, cma_new_area() generates names with format
> "cma%d\n", introducing an unintended newline character ('\n') in the
> CMA name.
>
> Most CMA regions are created with explicit names, so this path is
> seldom hit. The newline only creates cosmetic noise in debug logs,
> traces and debugfs with no functional impact.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> ---
> mm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index a7929c758df1..a10ea37a261d 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -242,7 +242,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;
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
2026-08-10 9:32 [PATCH] mm/cma: remove stray newline from auto-generated CMA area name Hongfu Li
2026-08-10 9:38 ` David Hildenbrand (Arm)
@ 2026-08-10 11:24 ` Lorenzo Stoakes (ARM)
2026-08-11 0:14 ` SJ Park
2026-08-11 6:12 ` Anshuman Khandual
3 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-10 11:24 UTC (permalink / raw)
To: Hongfu Li
Cc: akpm, david, liam, vbabka, rppt, surenb, mhocko, linux-mm,
linux-kernel, Hongfu Li
On Mon, Aug 10, 2026 at 05:32:15PM +0800, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> When no name is supplied, cma_new_area() generates names with format
> "cma%d\n", introducing an unintended newline character ('\n') in the
> CMA name.
>
> Most CMA regions are created with explicit names, so this path is
> seldom hit. The newline only creates cosmetic noise in debug logs,
> traces and debugfs with no functional impact.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
LGTM so:
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> ---
> mm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index a7929c758df1..a10ea37a261d 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -242,7 +242,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);
Ha :) I think somebody typo'd this on muscle memory gained from printk :)
>
> cma->available_count = cma->count = size >> PAGE_SHIFT;
> cma->order_per_bit = order_per_bit;
> --
> 2.54.0
>
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
2026-08-10 9:32 [PATCH] mm/cma: remove stray newline from auto-generated CMA area name Hongfu Li
2026-08-10 9:38 ` David Hildenbrand (Arm)
2026-08-10 11:24 ` Lorenzo Stoakes (ARM)
@ 2026-08-11 0:14 ` SJ Park
2026-08-11 6:12 ` Anshuman Khandual
3 siblings, 0 replies; 5+ messages in thread
From: SJ Park @ 2026-08-11 0:14 UTC (permalink / raw)
To: Hongfu Li
Cc: SJ Park, akpm, david, ljs, liam, vbabka, rppt, surenb, mhocko,
linux-mm, linux-kernel, Hongfu Li
On Mon, 10 Aug 2026 17:32:15 +0800 Hongfu Li <hongfu.li@linux.dev> wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> When no name is supplied, cma_new_area() generates names with format
> "cma%d\n", introducing an unintended newline character ('\n') in the
> CMA name.
Nice catch!
>
> Most CMA regions are created with explicit names, so this path is
> seldom hit. The newline only creates cosmetic noise in debug logs,
> traces and debugfs with no functional impact.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Reviewed-by: SJ Park <sj@kernel.org>
> ---
> mm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index a7929c758df1..a10ea37a261d 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -242,7 +242,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);
It also removes one unnecessary space! Nice!
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
2026-08-10 9:32 [PATCH] mm/cma: remove stray newline from auto-generated CMA area name Hongfu Li
` (2 preceding siblings ...)
2026-08-11 0:14 ` SJ Park
@ 2026-08-11 6:12 ` Anshuman Khandual
3 siblings, 0 replies; 5+ messages in thread
From: Anshuman Khandual @ 2026-08-11 6:12 UTC (permalink / raw)
To: Hongfu Li
Cc: akpm, david, ljs, liam, vbabka, rppt, surenb, mhocko, linux-mm,
linux-kernel, Hongfu Li
On Mon, Aug 10, 2026 at 05:32:15PM +0800, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> When no name is supplied, cma_new_area() generates names with format
> "cma%d\n", introducing an unintended newline character ('\n') in the
> CMA name.
>
> Most CMA regions are created with explicit names, so this path is
> seldom hit. The newline only creates cosmetic noise in debug logs,
> traces and debugfs with no functional impact.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> mm/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/cma.c b/mm/cma.c
> index a7929c758df1..a10ea37a261d 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -242,7 +242,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.54.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-11 6:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 9:32 [PATCH] mm/cma: remove stray newline from auto-generated CMA area name Hongfu Li
2026-08-10 9:38 ` David Hildenbrand (Arm)
2026-08-10 11:24 ` Lorenzo Stoakes (ARM)
2026-08-11 0:14 ` SJ Park
2026-08-11 6:12 ` Anshuman Khandual
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.