summaryrefslogtreecommitdiffstats
path: root/lib/rhashtable.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-12 04:49:40 +0100
committerDavid S. Miller <davem@davemloft.net>2015-03-12 19:35:30 +0100
commitcffaa9cb922472936b269017afdd3f147cb6f380 (patch)
tree4107259441940267b4c15cfdf4d5c1b2cd6c406a /lib/rhashtable.c
parentrhashtable: Use head_hashfn instead of obj_raw_hashfn (diff)
downloadlinux-cffaa9cb922472936b269017afdd3f147cb6f380.tar.xz
linux-cffaa9cb922472936b269017afdd3f147cb6f380.zip
rhashtable: Remove key length argument to key_hashfn
key_hashfn has only one caller and it doesn't really need to supply the key length as an extra parameter. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r--lib/rhashtable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 03fdaf869c4d..838cccc4ef7e 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -81,9 +81,10 @@ static u32 obj_raw_hashfn(struct rhashtable *ht,
}
static u32 key_hashfn(struct rhashtable *ht, const struct bucket_table *tbl,
- const void *key, u32 len)
+ const void *key)
{
- return rht_bucket_index(tbl, ht->p.hashfn(key, len, tbl->hash_rnd) >>
+ return rht_bucket_index(tbl, ht->p.hashfn(key, ht->p.key_len,
+ tbl->hash_rnd) >>
HASH_RESERVED_SPACE);
}
@@ -619,7 +620,7 @@ void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key,
rcu_read_lock();
tbl = rht_dereference_rcu(ht->tbl, ht);
- hash = key_hashfn(ht, tbl, key, ht->p.key_len);
+ hash = key_hashfn(ht, tbl, key);
restart:
rht_for_each_rcu(he, tbl, hash) {
if (!compare(rht_obj(ht, he), arg))