s390/iucv: Convert sprintf/snprintf to scnprintf
Subsystems (5)
Alexandra Winter
maintainerPATCH 1/1 s390/iucv: Convert sprintf/snprintf to scnprintf
From: Aswin Karuvally <[email protected]>
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 <[email protected]>
Signed-off-by Aswin Karuvally <[email protected]>
Signed-off-by Alexandra Winter <[email protected]>
--- 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(-)
drivers/s390/net/smsgiucv_app.c +4 -3
@@ -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; }
net/iucv/af_iucv.c +4 -3
@@ -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 ); }
net/iucv/iucv.c +1 -1
@@ -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)
Signature · 1 line
2.48.1
Quoted 9 lines · Alexandra Winter
From: Aswin Karuvally <[email protected]>
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 <[email protected]>Signed-off-by Aswin Karuvally <[email protected]>Signed-off-by Alexandra Winter <[email protected]>
Reviewed-by Simon Horman <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Fri, 17 Oct 2025 11:49:54 +0200 you wrote:
From: Aswin Karuvally <[email protected]>
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 <[email protected]>Signed-off-by Aswin Karuvally <[email protected]>Signed-off-by Alexandra Winter <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html