From: Alexandre TORGUE <alexandre.torgue@foss.st.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Gatien Chevallier <gatien.chevallier@foss.st.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: <linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] bus: rifsc: Replace snprintf("%s") with strscpy
Date: Tue, 10 Mar 2026 10:01:44 +0100 [thread overview]
Message-ID: <86e3d41b-79aa-477c-8cd3-93ce986922a7@foss.st.com> (raw)
In-Reply-To: <20260309223923.84283-3-thorsten.blum@linux.dev>
Hi Thorsten
On 3/9/26 23:39, Thorsten Blum wrote:
> Replace snprintf("%s", ...) with the faster and more direct strscpy().
>
> Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/bus/stm32_rifsc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/bus/stm32_rifsc.c b/drivers/bus/stm32_rifsc.c
> index debeaf8ea1bd..ba65ad21434b 100644
> --- a/drivers/bus/stm32_rifsc.c
> +++ b/drivers/bus/stm32_rifsc.c
> @@ -15,6 +15,7 @@
> #include <linux/of.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <linux/string.h>
> #include <linux/types.h>
>
> #include "stm32_firewall.h"
> @@ -450,7 +451,7 @@ static void stm32_rifsc_fill_rimu_dbg_entry(struct rifsc_dbg_private *rifsc,
> const struct stm32_rifsc_resources_names *dbg_names = rifsc->res_names;
> u32 rimc_attr = readl_relaxed(rifsc->mmio + RIFSC_RIMC_ATTR0 + 0x4 * i);
>
> - snprintf(dbg_entry->m_name, sizeof(dbg_entry->m_name), "%s", dbg_names->initiator_names[i]);
> + strscpy(dbg_entry->m_name, dbg_names->initiator_names[i]);
> dbg_entry->m_cid = FIELD_GET(RIFSC_RIMC_MCID_MASK, rimc_attr);
> dbg_entry->cidsel = rimc_attr & RIFSC_RIMC_CIDSEL;
> dbg_entry->m_sec = rimc_attr & RIFSC_RIMC_MSEC;
> @@ -469,8 +470,7 @@ static void stm32_rifsc_fill_dev_dbg_entry(struct rifsc_dbg_private *rifsc,
> sec_cfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_SECCFGR0 + 0x4 * reg_id);
> priv_cfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_PRIVCFGR0 + 0x4 * reg_id);
>
> - snprintf(dbg_entry->dev_name, sizeof(dbg_entry->dev_name), "%s",
> - dbg_names->device_names[i]);
> + strscpy(dbg_entry->dev_name, dbg_names->device_names[i]);
> dbg_entry->dev_id = i;
> dbg_entry->dev_cid_filt_en = cid_cfgr & CIDCFGR_CFEN;
> dbg_entry->dev_sem_en = cid_cfgr & CIDCFGR_SEMEN;
Applied on stm32-next.
Thanks.
Alex
prev parent reply other threads:[~2026-03-10 9:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 22:39 Thorsten Blum
2026-03-10 9:01 ` Alexandre TORGUE [this message]
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=86e3d41b-79aa-477c-8cd3-93ce986922a7@foss.st.com \
--to=alexandre.torgue@foss.st.com \
--cc=gatien.chevallier@foss.st.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--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®