Skip to contentSkip to conversation

net: caif: remove unused name

PATCH Applied Jakub Kicinski 4 participants 4 messages Sep 11, 2024 – Sep 13, 2024

Subsystems (2)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 net: caif: remove unused name

Justin sent a patch to use strscpy_pad() instead of strncpy()
on the name field. Simon rightly asked why the _pad() version
is used, and looking closer name seems completely unused,
the last code which referred to it was removed in
commit 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")

---
CC: [email protected]
CC: [email protected]

It's a bit unusual to take over patch submissions but the initial submission was too low effort to count :|

---
 net/caif/chnl_net.c | 2 --
 1 file changed, 2 deletions(-)
net/caif/chnl_net.c +0 -2
index 47901bd4def1..94ad09e36df2 100644
@@ -47,7 +47,6 @@ struct chnl_net {
 	struct caif_connect_request conn_req;
 	struct list_head list_field;
 	struct net_device *netdev;
-	char name[256];
 	wait_queue_head_t netmgmt_wq;
 	/* Flow status to remember and control the transmission. */
 	bool flowenabled;
@@ -347,7 +346,6 @@ static int chnl_net_init(struct net_device *dev)
 	struct chnl_net *priv;
 	ASSERT_RTNL();
 	priv = netdev_priv(dev);
-	strncpy(priv->name, dev->name, sizeof(priv->name));
 	INIT_LIST_HEAD(&priv->list_field);
 	return 0;
 }
Signature · 1 line
2.46.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jakub Kicinski

Justin sent a patch to use strscpy_pad() instead of strncpy()
on the name field. Simon rightly asked why the _pad() version
is used, and looking closer name seems completely unused,
the last code which referred to it was removed in
commit 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")

Quoted 8 lines

---
CC: [email protected]
CC: [email protected]

It's a bit unusual to take over patch submissions but the initial submission was too low effort to count :|

Acked-by on v1 1/1
#2 lore raw
In reply to Jakub Kicinski

Hi,

Quoted 6 lines · Jakub Kicinski

Justin sent a patch to use strscpy_pad() instead of strncpy()
on the name field. Simon rightly asked why the _pad() version
is used, and looking closer name seems completely unused,
the last code which referred to it was removed in
commit 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")

Thanks for looking into this a bit deeper.

Quoted 7 lines

---
CC: [email protected]
CC: [email protected]

Quoted 5 lines

It's a bit unusual to take over patch submissions but the initial submission was too low effort to count :|

---
 net/caif/chnl_net.c | 2 --
 1 file changed, 2 deletions(-)

the best kind of diff :)

Quoted 22 lines
net/caif/chnl_net.c +0 -3
index 47901bd4def1..94ad09e36df2 100644
@@ -47,7 +47,6 @@ struct chnl_net {
        struct caif_connect_request conn_req;
        struct list_head list_field;
        struct net_device *netdev;
-       char name[256];
        wait_queue_head_t netmgmt_wq;
        /* Flow status to remember and control the transmission. */
        bool flowenabled;
@@ -347,7 +346,6 @@ static int chnl_net_init(struct net_device *dev)
        struct chnl_net *priv;
        ASSERT_RTNL();
        priv = netdev_priv(dev);
-       strncpy(priv->name, dev->name, sizeof(priv->name));
        INIT_LIST_HEAD(&priv->list_field);
        return 0;
 }
--
Quoted 2 lines

2.46.0

#3 lore raw
In reply to Jakub Kicinski
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 10 lines · On Tue, 10 Sep 2024 18:52:28 -0700 you wrote:

Justin sent a patch to use strscpy_pad() instead of strncpy()
on the name field. Simon rightly asked why the _pad() version
is used, and looking closer name seems completely unused,
the last code which referred to it was removed in
commit 8391c4aab1aa ("caif: Bugfixes in CAIF netdevice for close and flow control")

[...]

Here is the summary with links:
- [net-next] net: caif: remove unused name

    https://git.kernel.org/netdev/net-next/c/5905c024a776

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html