[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <176442068835.77093.3412459996845909456.b4-ty@bootlin.com>
Date: Sat, 29 Nov 2025 13:51:28 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Thorsten Blum <thorsten.blum@...ux.dev>
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mtd: sm_ftl: Replace deprecated strncpy with
sysfs_emit in sm_attr_show
On Sun, 23 Nov 2025 19:21:02 +0100, Thorsten Blum wrote:
> strncpy() is deprecated [1] for NUL-terminated destination buffers
> because it does not guarantee NUL termination. It also unnecessarily
> NUL-pads the destination buffer if the source is shorter. Replace it
> with sysfs_emit() using the "%.*s" format specifier and supply the
> length 'sm_attr->len' to improve sm_attr_show().
>
> Return the number of characters actually written to 'buf' instead of
> 'sm_attr->len'.
>
> [...]
Applied to mtd/next, thanks!
[1/1] mtd: sm_ftl: Replace deprecated strncpy with sysfs_emit in sm_attr_show
commit: f3dc4d9898bc98e3cf569f038d90a5fec7bfc44a
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
Powered by blists - more mailing lists