From: David S. Miller Date: Sat, 3 Dec 2011 23:29:30 +0000 (-0500) Subject: ipv6: Kill ndisc_get_neigh() inline helper. X-Git-Tag: firefly_0821_release~3680^2~3834^2~367 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=04a6f4417bfd17c3860e8fb37387cb78265ffe44;p=firefly-linux-kernel-4.4.55.git ipv6: Kill ndisc_get_neigh() inline helper. It's only used in net/ipv6/route.c and the NULL device check is superfluous for all of the existing call sites. Just expand the __ndisc_lookup_errno() call at each location. Signed-off-by: David S. Miller --- diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 62beeb97c4b1..c977c377c015 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -145,13 +145,4 @@ int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, extern void inet6_ifinfo_notify(int event, struct inet6_dev *idev); -static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr) -{ - - if (dev) - return __neigh_lookup_errno(&nd_tbl, addr, dev); - - return ERR_PTR(-ENODEV); -} - #endif diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 897a13f7c6b1..1138b0a5566d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -744,7 +744,8 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort, #endif retry: - neigh = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); + neigh = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, + rt->rt6i_dev); if (IS_ERR(neigh)) { struct net *net = dev_net(rt->rt6i_dev); int saved_rt_min_interval = @@ -1085,7 +1086,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, if (neigh) neigh_hold(neigh); else { - neigh = ndisc_get_neigh(dev, addr); + neigh = __neigh_lookup_errno(&nd_tbl, addr, dev); if (IS_ERR(neigh)) neigh = NULL; } @@ -2082,7 +2083,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, rt->rt6i_flags |= RTF_ANYCAST; else rt->rt6i_flags |= RTF_LOCAL; - neigh = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); + neigh = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, rt->rt6i_dev); if (IS_ERR(neigh)) { dst_free(&rt->dst);