diff mbox series

[net-next] neighbour: remove neigh_parms_destroy()

Message ID 20250203151152.3163876-1-edumazet@google.com (mailing list archive)
State Accepted
Commit a064068bb6be51ed54f435fe7314c057f9eeb020
Delegated to: Netdev Maintainers
Headers show
Series [net-next] neighbour: remove neigh_parms_destroy() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: kuniyu@amazon.com gnaaman@drivenets.com
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-04--00-00 (tests: 886)

Commit Message

Eric Dumazet Feb. 3, 2025, 3:11 p.m. UTC
neigh_parms_destroy() is a simple kfree(), no need for
a forward declaration.

neigh_parms_put() can instead call kfree() directly.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/neighbour.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Simon Horman Feb. 4, 2025, 9:47 a.m. UTC | #1
On Mon, Feb 03, 2025 at 03:11:52PM +0000, Eric Dumazet wrote:
> neigh_parms_destroy() is a simple kfree(), no need for
> a forward declaration.
> 
> neigh_parms_put() can instead call kfree() directly.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

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.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Feb. 4, 2025, 10:20 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 89656d180bc60c57516d56be69774ed0c7b352b2..73260ca0fc22317e096ff5f17519e117f41ea48f 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -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;