public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
Cc: gregkh@linuxfoundation.org, johan@kernel.org, elder@kernel.org,
	schopin@ubuntu.com, me@abhy.me, greybus-dev@lists.linaro.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: documentation: replace strncpy() with strscpy_pad()
Date: Tue, 14 Oct 2025 16:53:02 +0300	[thread overview]
Message-ID: <aO5VvrKTswmfO-n9@stanley.mountain> (raw)
In-Reply-To: <20251014134148.2597178-1-vivek.balachandhar@gmail.com>

On Tue, Oct 14, 2025 at 01:41:48PM +0000, Vivek BalachandharTN wrote:
> strncpy() does not guarantee NUL-termination and is deprecated for
> NUL-terminated strings. Replace it with strscpy_pad(), which guarantees
> NUL-termination and zero-pads the remaining bytes, matching the fixed-size
> firmware tag semantics.
> 
> Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
> ---
>  .../greybus/Documentation/firmware/firmware.c        | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/greybus/Documentation/firmware/firmware.c b/drivers/staging/greybus/Documentation/firmware/firmware.c
> index 3b35ef6d4adb..deac8584841b 100644
> --- a/drivers/staging/greybus/Documentation/firmware/firmware.c
> +++ b/drivers/staging/greybus/Documentation/firmware/firmware.c

This is sample user space code so the strscpy_pad() isn't available.  It
will break the compile.

regards,
dan carpenter


  reply	other threads:[~2025-10-14 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 13:41 [PATCH] staging: greybus: documentation: replace strncpy() with strscpy_pad() Vivek BalachandharTN
2025-10-14 13:53 ` Dan Carpenter [this message]
2025-10-14 14:01   ` Vivek BalachandharTN
2025-10-14 14:15     ` Dan Carpenter
2025-10-14 16:10       ` Vivek BalachandharTN
2025-10-14 17:13         ` Dan Carpenter
2025-10-14 23:53           ` Vivek BalachandharTN

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=aO5VvrKTswmfO-n9@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=me@abhy.me \
    --cc=schopin@ubuntu.com \
    --cc=vivek.balachandhar@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