From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Osama Abdelkader <osama.abdelkader@gmail.com>
Cc: macro@orcam.me.uk, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mips: math-emu: replace deprecated strcpy() in me-debugfs
Date: Fri, 12 Sep 2025 13:51:54 +0200 [thread overview]
Message-ID: <aMQJWlDsvZ8sADQ1@alpha.franken.de> (raw)
In-Reply-To: <20250904192525.39830-1-osama.abdelkader@gmail.com>
On Thu, Sep 04, 2025 at 09:25:25PM +0200, Osama Abdelkader wrote:
> use strscpy() instead of deprecated strcpy().
>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
> v2:
> change function signature to get len and the caller.
> v3:
> use same parameters and arguments order
> ---
> arch/mips/math-emu/me-debugfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/math-emu/me-debugfs.c b/arch/mips/math-emu/me-debugfs.c
> index d5ad76b2bb67..49bf2b827ce2 100644
> --- a/arch/mips/math-emu/me-debugfs.c
> +++ b/arch/mips/math-emu/me-debugfs.c
> @@ -37,11 +37,11 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_fpuemu_stat, fpuemu_stat_get, NULL, "%llu\n");
> * used in debugfs item names to be clearly associated to corresponding
> * MIPS FPU instructions.
> */
> -static void adjust_instruction_counter_name(char *out_name, char *in_name)
> +static void adjust_instruction_counter_name(char *out_name, char *in_name, size_t len)
> {
> int i = 0;
>
> - strcpy(out_name, in_name);
> + strscpy(out_name, in_name, len);
> while (in_name[i] != '\0') {
> if (out_name[i] == '_')
> out_name[i] = '.';
> @@ -226,7 +226,7 @@ do { \
>
> #define FPU_STAT_CREATE_EX(m) \
> do { \
> - adjust_instruction_counter_name(name, #m); \
> + adjust_instruction_counter_name(name, #m, sizeof(name)); \
> \
> debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \
> (void *)FPU_EMU_STAT_OFFSET(m), \
> --
> 2.43.0
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2025-09-12 13:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 19:25 [PATCH v3] mips: math-emu: replace deprecated strcpy() in me-debugfs Osama Abdelkader
2025-09-12 11:51 ` Thomas Bogendoerfer [this message]
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=aMQJWlDsvZ8sADQ1@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=osama.abdelkader@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).