mm/cma: remove stray newline from auto-generated CMA area name

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.

Link: https://lore.kernel.org/[email protected]
Signed-off-by: Hongfu Li <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Reviewed-by: Lorenzo Stoakes (ARM) <[email protected]>
Reviewed-by: SJ Park <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Hongfu Li authored and Andrew Morton committed 2026-08-24 18:43:16 -07:00
1 parent 1f2b4b28aa
commit 097492865f
1 file changed
+1 -1
+1 -1
View File
@@ -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;