mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Hans de Goede <hansg@kernel.org>,
	Maximilian Luz <luzmaximilian@gmail.com>,
	<platform-driver-x86@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Thorsten Blum <thorsten.blum@linux.dev>
Subject: Re: [PATCH] platform/surface: Replace deprecated strcpy in surface_button_add
Date: Mon, 5 Jan 2026 22:41:07 +0800	[thread overview]
Message-ID: <aca8d8cd-0e71-4544-9e04-5144dc8a6c42@intel.com> (raw)
In-Reply-To: <57bc8c7b-72c6-e9a2-f03c-c840be6c9c35@linux.intel.com>

On 1/5/2026 10:21 PM, Ilpo Järvinen wrote:
> On Mon, 5 Jan 2026, Thorsten Blum wrote:
> 
>> 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);
> 
> I suggest you just remove 'name' instead. It seems pretty useless to begin
> with but especially after your patch. :-)

It was still used by other places.

thanks,
Chenyu
> 
> Please also add () to the subject line after function names.
> 

  reply	other threads:[~2026-01-05 14:41 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
2026-01-05 14:21     ` Ilpo Järvinen
2026-01-05 14:41       ` Chen, Yu C [this message]
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=aca8d8cd-0e71-4544-9e04-5144dc8a6c42@intel.com \
    --to=yu.c.chen@intel.com \
    --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=thorsten.blum@linux.dev \
    /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®