ipv6: icmp6_dst_gc return change

Change icmp6_dst_gc to return the one value the caller cares about rather
than using call by reference.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Stephen Hemminger
2008-07-22 14:35:50 -07:00
committed by David S. Miller
parent 75307c0fe7
commit 3d0f24a74e
3 changed files with 6 additions and 9 deletions

View File

@@ -978,13 +978,12 @@ out:
return &rt->u.dst;
}
int icmp6_dst_gc(int *more)
int icmp6_dst_gc(void)
{
struct dst_entry *dst, *next, **pprev;
int freed;
int more = 0;
next = NULL;
freed = 0;
spin_lock_bh(&icmp6_dst_lock);
pprev = &icmp6_dst_gc_list;
@@ -993,16 +992,15 @@ int icmp6_dst_gc(int *more)
if (!atomic_read(&dst->__refcnt)) {
*pprev = dst->next;
dst_free(dst);
freed++;
} else {
pprev = &dst->next;
(*more)++;
++more;
}
}
spin_unlock_bh(&icmp6_dst_lock);
return freed;
return more;
}
static int ip6_dst_gc(struct dst_ops *ops)