All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongfu Li <hongfu.li@linux.dev>
To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org,
	liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	hongfu.li@linux.dev, Hongfu Li <lihongfu@kylinos.cn>
Subject: [PATCH] mm/cma: remove stray newline from auto-generated CMA area name
Date: Mon, 10 Aug 2026 17:32:15 +0800	[thread overview]
Message-ID: <20260810093215.91419-1-hongfu.li@linux.dev> (raw)

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



             reply	other threads:[~2026-08-10  9:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  9:32 Hongfu Li [this message]
2026-08-10  9:38 ` [PATCH] mm/cma: remove stray newline from auto-generated CMA area name 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260810093215.91419-1-hongfu.li@linux.dev \
    --to=hongfu.li@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=lihongfu@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.