net: dst: Make dst_destroy() static and return void.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 2 Feb 2024 16:37:46 +0000 (17:37 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 Feb 2024 10:45:53 +0000 (11:45 +0100)
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>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240202163746.2489150-1-bigeasy@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/dst.h
net/core/dst.c

index f5dfc8fb7b3792b65360f30a302cf4d00c417243..0aa331bd2fdb7082e43fbb7c097229934de24507 100644 (file)
@@ -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)
index 6838d3212c37436859a3649a652f2388b00268de..95f533844f17f119c09f335ccf9bf09515dd3606 100644 (file)
@@ -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