From nobody Fri Dec 19 10:03:51 2025 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) (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 4F38432ED26 for ; Tue, 9 Dec 2025 12:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765285191; cv=none; b=aNn3rOhESvCNC2diNbom3VLFo3/KclZa88nS4RA7d6ci8Q1tlPAhdENefT9dClDtif1VOsPTCk3XUv4e6MUkCpx3AtlB7PzUKDuRuprGsZW3ZSuErSvudaXuTNJIZH9RB2kW/HPKBDK3qMItLPIed/KfA/k8NWkdQsslejWwDZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765285191; c=relaxed/simple; bh=awKM/yMg/t/z9/OBtVW7oo2asqfdDqtXuF9iKSyrqa0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J2MTUEliV3k8wiB1mTazPJfpPnI9bJwopC/8a9QAkuHEirwlcjYDF/RpoEC7V4SFnCTsjQRYhIwhNIWx/ibZpM3c208ZLzbt+T3XEfnLWXT3rK4eLCAWpjKLgNJcZLGvDq0aF6DovbTLGYckvwt1kVJVJH9iHMoDMV1PZI0PoRI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=hTvK5vQ+; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="hTvK5vQ+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=XS Lwr/vGdwX1A+YbZOMxdNFLT++ub2pkouiRlBUUQcI=; b=hTvK5vQ+nn9Bh0xn8t vVNpeiPG/b/GnvlQTLySuVa9IwRUVTqD7rznEvovEQvp4GTinkA8GUiCrYiOGYji A8uSuzi6I/XXQhHcNo08FD7SpxbP4FYPHOA2D6765TsHOS7nQPryDpmpPsnCw6FM jImpbWhCkcuIMKfOmtnqMrcmI= Received: from ubuntu.. (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wBHRiElHThpFxa+Ag--.2957S2; Tue, 09 Dec 2025 20:59:18 +0800 (CST) From: ny To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, ny Subject: [PATCH] perf tools: Replace strlcpy with strscpy Date: Tue, 9 Dec 2025 12:59:15 +0000 Message-ID: <20251209125915.305793-1-nygameemail@163.com> X-Mailer: git-send-email 2.43.0 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-CM-TRANSID: _____wBHRiElHThpFxa+Ag--.2957S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XFWktrWfAF15WryDWw13CFg_yoWfWFgEkw 1xKr1rtrW5XrZrt342kFWF9a48Gw47ZrW8JFZ7G39Iyan7Ja18uFZYkr9rZr15trn8tFZx Cw15J3Wjvr47KjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRt-eO7UUUUU== X-CM-SenderInfo: 5q1jtz5hhptxro6rljoofrz/xtbCxge4cGk4HScbXAAA3l Content-Type: text/plain; charset="utf-8" Replace the deprecated strlcpy function with the preferred strscpy function in tools/perf/util/machine.c. strlcpy is deprecated and should be replaced with strscpy according to kernel best practices. The strscpy function is safer and is the recommended replacement. Signed-off-by: ny --- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 841b711d9..8786764e2 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1052,7 +1052,7 @@ int machine__create_extra_kernel_map(struct machine *= machine, =20 kmap =3D map__kmap(map); =20 - strlcpy(kmap->name, xm->name, KMAP_NAME_LEN); + strscpy(kmap->name, xm->name, KMAP_NAME_LEN); =20 err =3D maps__insert(machine__kernel_maps(machine), map); =20 --=20 2.43.0