From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: "Chen, Yu C" <yu.c.chen@intel.com>,
Hans de Goede <hansg@kernel.org>,
Maximilian Luz <luzmaximilian@gmail.com>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/surface: Replace deprecated strcpy in surface_button_add
Date: Mon, 5 Jan 2026 16:21:56 +0200 (EET) [thread overview]
Message-ID: <57bc8c7b-72c6-e9a2-f03c-c840be6c9c35@linux.intel.com> (raw)
In-Reply-To: <BAED6C05-841E-4BEB-878F-6049D20669FE@linux.dev>
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. :-)
Please also add () to the subject line after function names.
--
i.
next prev parent reply other threads:[~2026-01-05 14:22 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 [this message]
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=57bc8c7b-72c6-e9a2-f03c-c840be6c9c35@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
--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®