diff options
author | Thomas Graf <tgraf@suug.ch> | 2015-01-02 17:00:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-03 14:32:56 -0500 |
commit | 8d24c0b43125ec26cc80e04588477a9a2afc025c (patch) | |
tree | d02e1b74bf49017dd4fecdeaf82a1e4f8f64a25d /net/netlink | |
parent | dd9553988879a3ff71a86323b88409e7631c4e5d (diff) |
rhashtable: Do hashing inside of rhashtable_lookup_compare()
Hash the key inside of rhashtable_lookup_compare() like
rhashtable_lookup() does. This allows to simplify the hashing
functions and keep them private.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: netfilter-devel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 84ea76ca3f1f..a5d7ed627563 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1002,11 +1002,8 @@ static struct sock *__netlink_lookup(struct netlink_table *table, u32 portid, | |||
1002 | .net = net, | 1002 | .net = net, |
1003 | .portid = portid, | 1003 | .portid = portid, |
1004 | }; | 1004 | }; |
1005 | u32 hash; | ||
1006 | 1005 | ||
1007 | hash = rhashtable_hashfn(&table->hash, &portid, sizeof(portid)); | 1006 | return rhashtable_lookup_compare(&table->hash, &portid, |
1008 | |||
1009 | return rhashtable_lookup_compare(&table->hash, hash, | ||
1010 | &netlink_compare, &arg); | 1007 | &netlink_compare, &arg); |
1011 | } | 1008 | } |
1012 | 1009 | ||