* [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf
@ 2025-10-17 9:49 Alexandra Winter
2025-10-20 9:52 ` Simon Horman
2025-10-21 1:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Alexandra Winter @ 2025-10-17 9:49 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn, Aswin Karuvally, Thorsten Winkler
Cc: netdev, linux-s390, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Simon Horman
From: Aswin Karuvally <aswin@linux.ibm.com>
Convert sprintf/snprintf calls to scnprintf to better align with the
kernel development community practices [1].
Link: https://lwn.net/Articles/69419 [1]
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
---
drivers/s390/net/smsgiucv_app.c | 7 ++++---
net/iucv/af_iucv.c | 7 ++++---
net/iucv/iucv.c | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/s390/net/smsgiucv_app.c b/drivers/s390/net/smsgiucv_app.c
index 4bd4d6bfc126..768108c90b32 100644
--- a/drivers/s390/net/smsgiucv_app.c
+++ b/drivers/s390/net/smsgiucv_app.c
@@ -88,9 +88,10 @@ static struct smsg_app_event *smsg_app_event_alloc(const char *from,
ev->envp[3] = NULL;
/* setting up environment: sender, prefix name, and message text */
- snprintf(ev->envp[0], ENV_SENDER_LEN, ENV_SENDER_STR "%s", from);
- snprintf(ev->envp[1], ENV_PREFIX_LEN, ENV_PREFIX_STR "%s", SMSG_PREFIX);
- snprintf(ev->envp[2], ENV_TEXT_LEN(msg), ENV_TEXT_STR "%s", msg);
+ scnprintf(ev->envp[0], ENV_SENDER_LEN, ENV_SENDER_STR "%s", from);
+ scnprintf(ev->envp[1], ENV_PREFIX_LEN, ENV_PREFIX_STR "%s",
+ SMSG_PREFIX);
+ scnprintf(ev->envp[2], ENV_TEXT_LEN(msg), ENV_TEXT_STR "%s", msg);
return ev;
}
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 6c717a7ef292..4ddfc633d30c 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -553,10 +553,11 @@ static void __iucv_auto_name(struct iucv_sock *iucv)
{
char name[12];
- sprintf(name, "%08x", atomic_inc_return(&iucv_sk_list.autobind_name));
+ scnprintf(name, sizeof(name),
+ "%08x", atomic_inc_return(&iucv_sk_list.autobind_name));
while (__iucv_get_sock_by_name(name)) {
- sprintf(name, "%08x",
- atomic_inc_return(&iucv_sk_list.autobind_name));
+ scnprintf(name, sizeof(name), "%08x",
+ atomic_inc_return(&iucv_sk_list.autobind_name));
}
memcpy(iucv->src_name, name, 8);
}
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 473a7847d80b..008be0abe3a5 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -95,7 +95,7 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs,
if (!dev)
goto out_error;
va_start(vargs, fmt);
- vsnprintf(buf, sizeof(buf), fmt, vargs);
+ vscnprintf(buf, sizeof(buf), fmt, vargs);
rc = dev_set_name(dev, "%s", buf);
va_end(vargs);
if (rc)
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf
2025-10-17 9:49 [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf Alexandra Winter
@ 2025-10-20 9:52 ` Simon Horman
2025-10-21 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-10-20 9:52 UTC (permalink / raw)
To: Alexandra Winter
Cc: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn, Aswin Karuvally, Thorsten Winkler, netdev,
linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle
On Fri, Oct 17, 2025 at 11:49:54AM +0200, Alexandra Winter wrote:
> From: Aswin Karuvally <aswin@linux.ibm.com>
>
> Convert sprintf/snprintf calls to scnprintf to better align with the
> kernel development community practices [1].
>
> Link: https://lwn.net/Articles/69419 [1]
> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
> Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
> Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf
2025-10-17 9:49 [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf Alexandra Winter
2025-10-20 9:52 ` Simon Horman
@ 2025-10-21 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-21 1:40 UTC (permalink / raw)
To: Alexandra Winter
Cc: davem, kuba, pabeni, edumazet, andrew+netdev, aswin, twinkler,
netdev, linux-s390, hca, gor, agordeev, borntraeger, svens, horms
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 17 Oct 2025 11:49:54 +0200 you wrote:
> From: Aswin Karuvally <aswin@linux.ibm.com>
>
> Convert sprintf/snprintf calls to scnprintf to better align with the
> kernel development community practices [1].
>
> Link: https://lwn.net/Articles/69419 [1]
> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
> Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
> Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
>
> [...]
Here is the summary with links:
- [net-next] s390/iucv: Convert sprintf/snprintf to scnprintf
https://git.kernel.org/netdev/net-next/c/38516e3fa4ca
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-21 1:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 9:49 [PATCH net-next] s390/iucv: Convert sprintf/snprintf to scnprintf Alexandra Winter
2025-10-20 9:52 ` Simon Horman
2025-10-21 1:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).