diff mbox series

[net-next] net: dst: Make dst_destroy() static and return void.

Message ID 20240202163746.2489150-1-bigeasy@linutronix.de (mailing list archive)
State Accepted
Commit 03ba6dc035c60991033529e630bd1552b2bca4d7
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: dst: Make dst_destroy() static and return void. | 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: 3602 this patch: 3602
netdev/build_tools success Errors and warnings before: 1 this patch: 0
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1127 this patch: 1127
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: 3813 this patch: 3813
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 31 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-2024-02-04--21-00 (tests: 721)

Commit Message

Sebastian Andrzej Siewior Feb. 2, 2024, 4:37 p.m. UTC
Since commit 52df157f17e56 ("xfrm: take refcnt of dst when creating
struct xfrm_dst bundle") dst_destroy() returns only NULL and no caller
cares about the return value.
There are no in in-tree users of dst_destroy() outside of the file.

Make dst_destroy() static and return void.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/net/dst.h | 1 -
 net/core/dst.c    | 6 ++----
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Eric Dumazet Feb. 2, 2024, 4:40 p.m. UTC | #1
On Fri, Feb 2, 2024 at 5:37 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> Since commit 52df157f17e56 ("xfrm: take refcnt of dst when creating
> struct xfrm_dst bundle") dst_destroy() returns only NULL and no caller
> cares about the return value.
> There are no in in-tree users of dst_destroy() outside of the file.
>
> Make dst_destroy() static and return void.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

This seems legit, thanks.

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org Feb. 6, 2024, 10:50 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Fri,  2 Feb 2024 17:37:46 +0100 you wrote:
> Since commit 52df157f17e56 ("xfrm: take refcnt of dst when creating
> struct xfrm_dst bundle") dst_destroy() returns only NULL and no caller
> cares about the return value.
> There are no in in-tree users of dst_destroy() outside of the file.
> 
> Make dst_destroy() static and return void.
> 
> [...]

Here is the summary with links:
  - [net-next] net: dst: Make dst_destroy() static and return void.
    https://git.kernel.org/netdev/net-next/c/03ba6dc035c6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/dst.h b/include/net/dst.h
index f5dfc8fb7b379..0aa331bd2fdb7 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -390,7 +390,6 @@  void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
 void dst_init(struct dst_entry *dst, struct dst_ops *ops,
 	      struct net_device *dev, int initial_obsolete,
 	      unsigned short flags);
-struct dst_entry *dst_destroy(struct dst_entry *dst);
 void dst_dev_put(struct dst_entry *dst);
 
 static inline void dst_confirm(struct dst_entry *dst)
diff --git a/net/core/dst.c b/net/core/dst.c
index 6838d3212c374..95f533844f17f 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -96,7 +96,7 @@  void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
 }
 EXPORT_SYMBOL(dst_alloc);
 
-struct dst_entry *dst_destroy(struct dst_entry * dst)
+static void dst_destroy(struct dst_entry *dst)
 {
 	struct dst_entry *child = NULL;
 
@@ -126,15 +126,13 @@  struct dst_entry *dst_destroy(struct dst_entry * dst)
 	dst = child;
 	if (dst)
 		dst_release_immediate(dst);
-	return NULL;
 }
-EXPORT_SYMBOL(dst_destroy);
 
 static void dst_destroy_rcu(struct rcu_head *head)
 {
 	struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head);
 
-	dst = dst_destroy(dst);
+	dst_destroy(dst);
 }
 
 /* Operations to mark dst as DEAD and clean up the net device referenced