From: ny <nygameemail@163.com>
To: acme@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
linux-kernel@vger.kernel.org, ny <nygameemail@163.com>
Subject: [PATCH] perf tools: Replace strlcpy with strscpy
Date: Tue, 9 Dec 2025 12:59:15 +0000 [thread overview]
Message-ID: <20251209125915.305793-1-nygameemail@163.com> (raw)
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 <nygameemail@163.com>
---
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,
kmap = map__kmap(map);
- strlcpy(kmap->name, xm->name, KMAP_NAME_LEN);
+ strscpy(kmap->name, xm->name, KMAP_NAME_LEN);
err = maps__insert(machine__kernel_maps(machine), map);
--
2.43.0
next reply other threads:[~2025-12-09 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 12:59 ny [this message]
2026-01-13 20:06 ` Arnaldo Carvalho de Melo
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=20251209125915.305793-1-nygameemail@163.com \
--to=nygameemail@163.com \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®