Patchwork [net-next,3/7] net/ipv4: Move arp_hashfn into arp_hash

login
register
mail settings
Submitter dsahern@kernel.org
Date Dec. 5, 2018, 11:34 p.m.
Message ID <20181205233414.1386-4-dsahern@kernel.org>
Download mbox | patch
Permalink /patch/673609/
State New
Headers show

Comments

dsahern@kernel.org - Dec. 5, 2018, 11:34 p.m.
From: David Ahern <dsahern@gmail.com>

There are no more direct references to arp_hashfn so fold it into
arp_hash, the hash callback for arp.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 include/net/arp.h | 8 --------
 net/ipv4/arp.c    | 5 ++++-
 2 files changed, 4 insertions(+), 9 deletions(-)

Patch

diff --git a/include/net/arp.h b/include/net/arp.h
index a5091f13cd3e..9f433c077b67 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -10,14 +10,6 @@ 
 
 extern struct neigh_table arp_tbl;
 
-static inline u32 arp_hashfn(const void *pkey, const struct net_device *dev, u32 *hash_rnd)
-{
-	u32 key = *(const u32 *)pkey;
-	u32 val = key ^ hash32_ptr(dev);
-
-	return val * hash_rnd[0];
-}
-
 static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *dev, u32 key)
 {
 	if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 850a6f13a082..6b88211287ae 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -213,7 +213,10 @@  static u32 arp_hash(const void *pkey,
 		    const struct net_device *dev,
 		    __u32 *hash_rnd)
 {
-	return arp_hashfn(pkey, dev, hash_rnd);
+	u32 key = *(const u32 *)pkey;
+	u32 val = key ^ hash32_ptr(dev);
+
+	return val * hash_rnd[0];
 }
 
 static bool arp_key_eq(const struct neighbour *neigh, const void *pkey)