mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	Thomas Gleixner <tglx@linutronix.de>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	 "H. Peter Anvin" <hpa@zytor.com>,
	Brian Gerst <brgerst@gmail.com>,
	 "Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Xin Li (Intel)" <xin@zytor.com>,
	 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	 "Ahmed S. Darwish" <darwi@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/common: Replace deprecated strcpy() with strscpy()
Date: Mon, 18 Aug 2025 09:13:25 +0000	[thread overview]
Message-ID: <DC5FSK5QO5B4.2IJ9JV7V88Z96@google.com> (raw)
In-Reply-To: <20250816152820.427784-2-thorsten.blum@linux.dev>

On Sat Aug 16, 2025 at 3:28 PM UTC, Thorsten Blum wrote:
> strcpy() is deprecated; use strscpy() instead.

Seems like a good NOP to me.

Reviewed-By: Brendan Jackman <jackmanb@google.com>

> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> Note: I already submitted this in April as part of another patch [1]
> which doesn't apply anymore. Submitting this again as a separate patch.
> [1]: https://lore.kernel.org/lkml/20250425074917.1531-3-thorsten.blum@linux.dev/
> ---
>  arch/x86/kernel/cpu/common.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 34a054181c4d..8aa170762cc7 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -184,9 +184,9 @@ static void default_init(struct cpuinfo_x86 *c)
>  	if (c->cpuid_level == -1) {
>  		/* No cpuid. It must be an ancient CPU */
>  		if (c->x86 == 4)
> -			strcpy(c->x86_model_id, "486");
> +			strscpy(c->x86_model_id, "486");
>  		else if (c->x86 == 3)
> -			strcpy(c->x86_model_id, "386");
> +			strscpy(c->x86_model_id, "386");
>  	}
>  #endif
>  }
> @@ -2013,7 +2013,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
>  		const char *p;
>  		p = table_lookup_model(c);
>  		if (p)
> -			strcpy(c->x86_model_id, p);
> +			strscpy(c->x86_model_id, p);
>  		else
>  			/* Last resort... */
>  			sprintf(c->x86_model_id, "%02x/%02x",


      reply	other threads:[~2025-08-18  9:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16 15:28 Thorsten Blum
2025-08-18  9:13 ` Brendan Jackman [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=DC5FSK5QO5B4.2IJ9JV7V88Z96@google.com \
    --to=jackmanb@google.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thorsten.blum@linux.dev \
    --cc=x86@kernel.org \
    --cc=xin@zytor.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

all inboxes | Powered by JetHome®