From nobody Mon Jan 26 22:45:22 2026 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7DC933985 for ; Mon, 26 Jan 2026 17:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769449538; cv=none; b=XvmBDFJZGYqNnpbsckFkES0anq1yaKNv/cKdp96hAXuiJRpNX+nxYl3BFVBMHqMh4MmzJJPe9Vja7Rr+0u6+yWVFmEgVb1PUu32K5WbotOj1tf3eKX1dfx9rsxznay4npJT9wQ0P+RL5/+QyQpii82jSAH+Y2e4vhvCXIcEscGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769449538; c=relaxed/simple; bh=myO3//0+TXT3Bbz5vAIiZ70QVzw3Fcni5suhhL0ZGjg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uc+YwyV07z3umeq3N+uWRAXFqJcPqQwX5YWAXhozHeQoDPty7d2nd118zoO3PhnIa4Sgz4qM8cipGiG9ozNvvOjr2Hfxb0JxrE2T8BswrQdM64E895lVPuu7k8o6+UIIBJULz/avTE29KBpjUDp6Fb/l637/zJ0CnVGAjOZe9Gk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=r9tmsaTz; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="r9tmsaTz" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769449533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wtayOmnwhUzFcyDzarUn+KEuppFLbcz0NQpv/iLeOf8=; b=r9tmsaTzW9s6q4OnJzUK+BShlrGwE4QmjdaGRsqWmlcU+fvwjOPlj59SnzxBP8bpRmGP8Y NCH05w8oJmXteT7xU7fX71v6VLTm55hl7bj14uZbIDk+k021HEMedqUTUoDxwctRugtb8X M7asHi8Uj1CHlyEYyZg/eGckK1rYUno= From: Thorsten Blum To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko Cc: Thorsten Blum , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/cma: Replace snprintf with strscpy in cma_new_area Date: Mon, 26 Jan 2026 18:45:15 +0100 Message-ID: <20260126174516.236968-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace snprintf("%s", ...) with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum --- mm/cma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 813e6dc7b095..44b43de28c13 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -233,7 +234,7 @@ static int __init cma_new_area(const char *name, phys_a= ddr_t size, cma_area_count++; =20 if (name) - snprintf(cma->name, CMA_MAX_NAME, "%s", name); + strscpy(cma->name, name); else snprintf(cma->name, CMA_MAX_NAME, "cma%d\n", cma_area_count); =20 --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4