mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: "Chen, Yu C" <yu.c.chen@intel.com>
Cc: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Maximilian Luz" <luzmaximilian@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/surface: Replace deprecated strcpy in surface_button_add
Date: Mon, 5 Jan 2026 14:38:22 +0100	[thread overview]
Message-ID: <BAED6C05-841E-4BEB-878F-6049D20669FE@linux.dev> (raw)
In-Reply-To: <4cadf166-2693-489e-a6f7-ae986694fd88@intel.com>

On 5. Jan 2026, at 13:52, Chen, Yu C wrote:
>> -	strcpy(name, SURFACE_BUTTON_DEVICE_NAME);
>> +	strscpy(acpi_device_name(device), SURFACE_BUTTON_DEVICE_NAME);
> 
> Thanks for the fix, a minor question might be why we do not reuse
> name by strscpy(name, SURFACE_BUTTON_DEVICE_NAME) ?

Because 'name' is a 'char *' from which the size of the destination
buffer cannot be inferred by the 2-argument version of strscpy().

Using 'name' would force us to use strscpy() with 3 arguments:

strscpy(name, SURFACE_BUTTON_DEVICE_NAME, MAX_ACPI_DEVICE_NAME_LEN);

Thanks,
Thorsten


  reply	other threads:[~2026-01-05 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 12:18 Thorsten Blum
2026-01-05 12:52 ` Chen, Yu C
2026-01-05 13:38   ` Thorsten Blum [this message]
2026-01-05 14:21     ` Ilpo Järvinen
2026-01-05 14:41       ` Chen, Yu C
2026-01-05 14:39     ` Chen, Yu C

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=BAED6C05-841E-4BEB-878F-6049D20669FE@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=yu.c.chen@intel.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®