Skip to contentSkip to conversation

neighbour: remove neigh_parms_destroy()

PATCH Applied Eric Dumazet 3 participants 3 messages Feb 3, 2025 – Feb 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 neighbour: remove neigh_parms_destroy()

neigh_parms_destroy() is a simple kfree(), no need for a forward declaration.

neigh_parms_put() can instead call kfree() directly.

---
 net/core/neighbour.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
net/core/neighbour.c +1 -8
index 89656d180bc60c57516d56be69774ed0c7b352b2..73260ca0fc22317e096ff5f17519e117f41ea48f 100644
@@ -832,12 +832,10 @@ static int pneigh_ifdown_and_unlock(struct neigh_table *tbl,
 	return -ENOENT;
 }
 
-static void neigh_parms_destroy(struct neigh_parms *parms);
-
 static inline void neigh_parms_put(struct neigh_parms *parms)
 {
 	if (refcount_dec_and_test(&parms->refcnt))
-		neigh_parms_destroy(parms);
+		kfree(parms);
 }
 
 /*
@@ -1713,11 +1711,6 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
 }
 EXPORT_SYMBOL(neigh_parms_release);
 
-static void neigh_parms_destroy(struct neigh_parms *parms)
-{
-	kfree(parms);
-}
-
 static struct lock_class_key neigh_table_proxy_queue_class;
 
 static struct neigh_table __rcu *neigh_tables[NEIGH_NR_TABLES] __read_mostly;
Signature · 1 line
2.48.1.362.g079036d154-goog
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Eric Dumazet

neigh_parms_destroy() is a simple kfree(), no need for a forward declaration.

neigh_parms_put() can instead call kfree() directly.

Thanks Eric,

I agree that this is the case. And I think it has been so since commit efd7ef1c1929 ("net: Kill hold_net release_net"). Or, IOW, for about 10 years by now.

#2 lore raw
In reply to Eric Dumazet
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 8 lines · On Mon, 3 Feb 2025 15:11:52 +0000 you wrote:

neigh_parms_destroy() is a simple kfree(), no need for a forward declaration.

neigh_parms_put() can instead call kfree() directly.

[...]

Here is the summary with links:
- [net-next] neighbour: remove neigh_parms_destroy()

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

You are awesome, thank you!

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