mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tung Quang Nguyen <tung.quang.nguyen@est.tech>
To: Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>,
	"jmaloy@redhat.com" <jmaloy@redhat.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"tipc-discussion@lists.sourceforge.net"
	<tipc-discussion@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] Removing deprecated strncpy()
Date: Fri, 11 Apr 2025 05:22:10 +0000	[thread overview]
Message-ID: <PRAP189MB1897827A01B6C6827EEE1CB3C6B62@PRAP189MB1897.EURP189.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250411050613.10550-1-kevinpaul468@gmail.com>

>This patch suggests the replacement of strncpy with strscpy as per
>Documentation/process/deprecated.
>The strncpy() fails to guarntee NULL termination, The function adds zero pads
>which isn't really convenient for short strings as it may cause performce issues
>
>strscpy() is a preffered replacement because it overcomes the limitations of
>strncpy mentioned above
>
Please read my comment for your previous patch:
- Add "net-next" to your email subject like this: [PATCH net-next]
- Fix many typos in your changelog:  guarntee -> guarantee, performce --> performance, preffered --> preferred
>Compile Tested
>
>Signed-off-by: Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>
>---
> net/tipc/node.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/net/tipc/node.c b/net/tipc/node.c index
>ccf5e427f43e..cb43f2016a70 100644
>--- a/net/tipc/node.c
>+++ b/net/tipc/node.c
>@@ -1581,7 +1581,7 @@ int tipc_node_get_linkname(struct net *net, u32
>bearer_id, u32 addr,
> 	tipc_node_read_lock(node);
> 	link = node->links[bearer_id].link;
> 	if (link) {
>-		strncpy(linkname, tipc_link_name(link), len);
>+		strscpy(linkname, tipc_link_name(link), len);
please merge this change into your previous patch. We do not need a separate patch for the same purpose.

  reply	other threads:[~2025-04-11  5:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11  5:06 Kevin Paul Reddy Janagari
2025-04-11  5:22 ` Tung Quang Nguyen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-10 12:32 Kevin Paul Reddy Janagari
2025-04-11  1:10 ` Tung Quang Nguyen
2025-04-10 11:32 Kevin Paul Reddy Janagari
2025-04-10 11:54 ` Heiko Carstens

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=PRAP189MB1897827A01B6C6827EEE1CB3C6B62@PRAP189MB1897.EURP189.PROD.OUTLOOK.COM \
    --to=tung.quang.nguyen@est.tech \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kevinpaul468@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    /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®