Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: "Maxwell Doose" <m32285159@gmail.com>
To: "Lucas Poupeau" <lucasp.linux@gmail.com>,
	<linus.walleij@linaro.org>, <brgl@bgdev.pl>
Cc: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools: gpio: replace strncpy with strscpy
Date: Mon, 04 May 2026 15:18:54 -0500	[thread overview]
Message-ID: <DIA656PT46GW.2Q15WVT679RS6@gmail.com> (raw)
In-Reply-To: <20260504195251.53771-1-lucasp.linux@gmail.com>

Hi Lucas,

On Mon, May 4, 2026 at 2:53 PM Lucas Poupeau <lucasp.linux@gmail.com> wrote:
>
> Replace strncpy with strscpy in gpio-utils.c. strscpy is the preferred
> way to copy strings in the kernel as it guarantees NUL-termination and
> is more robust.
>
> Reported by checkpatch.pl.
>
> Signed-off-by: Lucas Poupeau <lucasp.linux@gmail.com>
> ---
>  tools/gpio/gpio-utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
[snip]

There's already someone working on this:

https://lore.kernel.org/linux-gpio/20260504134532.0438e390@pumpkin/

but to be honest this one is much better than that one. Just some quick
recommendations, please change:

>+       strscpy(req.consumer, consumer);

to be something like:

	strscpy(req.consumer, consumer, sizeof(req.consumer));

Also, please double check the commit message and subject (says strncpy,
should be strcpy). Once you fix those issues feel free to add my
reviewed-by (Reviewed-by: Maxwell Doose <m32285159@gmail.com>).

best regards,
max

  reply	other threads:[~2026-05-04 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 19:52 [PATCH] tools: gpio: replace strncpy with strscpy Lucas Poupeau
2026-05-04 20:18 ` Maxwell Doose [this message]
     [not found]   ` <CAKYXYMRX-oV6iO+Kh+dV7_2BfsY9gjdXMw6cueOgYw2hjLWeaQ@mail.gmail.com>
2026-05-04 20:54     ` Maxwell Doose
2026-05-04 21:00       ` Maxwell Doose
     [not found]         ` <CAKYXYMQQ2UxLJw=2O2y=fLL6Kpp3eUiaH7Rx4MF5H7wcoYzcLQ@mail.gmail.com>
2026-05-04 21:14           ` Maxwell Doose
2026-05-05 10:57             ` Bartosz Golaszewski
2026-05-05 13:15               ` Maxwell Doose

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=DIA656PT46GW.2Q15WVT679RS6@gmail.com \
    --to=m32285159@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucasp.linux@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